<html>
 <head>
  <meta charset="utf-8"/>
  <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport"/>
  <title>
   MySQL索引原理及慢查询优化  | 数螺 | NAUT IDEA
  </title>
  <link href="http://cdn.bootcss.com/bootstrap/3.3.6/css/bootstrap-theme.min.css" rel="stylesheet"/>
  <link href="http://cdn.bootcss.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet"/>
  <style type="text/css">
   #xmain img {
                  max-width: 100%;
                  display: block;
                  margin-top: 10px;
                  margin-bottom: 10px;
                }

                #xmain p {
                    line-height:150%;
                    font-size: 16px;
                    margin-top: 20px;
                }

                #xmain h2 {
                    font-size: 24px;
                }

                #xmain h3 {
                    font-size: 20px;
                }

                #xmain h4 {
                    font-size: 18px;
                }


                .header {
	           background-color: #0099ff;
	           color: #ffffff;
	           margin-bottom: 20px;
	        }

	        .header p {
                  margin: 0px;
                  padding: 10px 0;
                  display: inline-block;  
                  vertical-align: middle;
                  font-size: 16px;
               }

               .header a {
                 color: white;
               }

              .header img {
                 height: 25px;
              }
  </style>
  <script src="http://cdn.bootcss.com/jquery/3.0.0/jquery.min.js">
  </script>
  <script src="http://nautstatic-10007657.file.myqcloud.com/static/css/readability.min.js" type="text/javascript">
  </script>
  <script type="text/javascript">
   $(document).ready(function() {
                 var loc = document.location;
                 var uri = {
                  spec: "http://dataunion.org/16514.html",
                  host: "http://dataunion.org",
                  prePath: "http://dataunion.org",
                  scheme: "http",
                  pathBase: "http://dataunion.org/"
                 };
    
                 var documentClone = document.cloneNode(true);
                 var article = new Readability(uri, documentClone).parse();
     
                 document.getElementById("xmain").innerHTML = article.content;
                });
  </script>
  <!-- 1466459619: Accept with keywords: (title(0.5):原理,社区,优化,数盟, topn(0.333333333333):原则,数盟,查找,时间,内存,原理,数据库,例子,基础架构,文章,情况,排序,数据,节点,数据项,场景,记录,性能,关联,数据表,磁盘,优化,区分度,指针,语句,顺序,案例,业务,字段,数据结构).-->
 </head>
 <body onload="">
  <div class="header">
   <div class="container">
    <div class="row">
     <div class="col-xs-6 col-sm-6 text-left">
      <a href="/databee">
       <img src="http://nautidea-10007657.cos.myqcloud.com/logo_white.png"/>
      </a>
      <a href="/databee">
       <p>
        数螺
       </p>
      </a>
     </div>
     <div class="hidden-xs col-sm-6 text-right">
      <p>
       致力于数据科学的推广和知识传播
      </p>
     </div>
    </div>
   </div>
  </div>
  <div class="container text-center">
   <h1>
    MySQL索引原理及慢查询优化
   </h1>
  </div>
  <div class="container" id="xmain">
   ﻿﻿
   <title>
    MySQL索引原理及慢查询优化 | 数盟社区
   </title>
   <!-- All in One SEO Pack 2.2.7.6.2 by Michael Torbert of Semper Fi Web Design[32,62] -->
   <!-- /all in one seo pack -->
   <!--
<div align="center">
<a href="http://strata.oreilly.com.cn/hadoop-big-data-cn?cmp=mp-data-confreg-home-stcn16_dataunion_pc" target="_blank"><img src="http://dataunion.org/wp-content/uploads/2016/05/stratabj.jpg"/ ></a>
</div>
-->
   <header id="header-web">
    <div class="header-main">
     <hgroup class="logo">
      <h1>
       <a href="http://dataunion.org/" rel="home" title="数盟社区">
        <img src="http://dataunion.org/wp-content/themes/yzipi/images/logo.png"/>
       </a>
      </h1>
     </hgroup>
     <!--logo-->
     <nav class="header-nav">
      <ul class="menu" id="menu-%e4%b8%bb%e8%8f%9c%e5%8d%95">
       <li class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-has-children menu-item-71" id="menu-item-71">
        <a href="http://dataunion.org/category/events" title="events">
         活动
        </a>
        <ul class="sub-menu">
         <li class="menu-item menu-item-type-post_type menu-item-object-page menu-item-22457" id="menu-item-22457">
          <a href="http://dataunion.org/2016timeline">
           2016档期
          </a>
         </li>
         <li class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-22459" id="menu-item-22459">
          <a href="http://dataunion.org/category/parterc">
           合作会议
          </a>
         </li>
        </ul>
       </li>
       <li class="menu-item menu-item-type-taxonomy menu-item-object-category current-post-ancestor menu-item-has-children menu-item-20869" id="menu-item-20869">
        <a href="http://dataunion.org/category/tech" title="articles">
         文章
        </a>
        <ul class="sub-menu">
         <li class="menu-item menu-item-type-taxonomy menu-item-object-category current-post-ancestor current-menu-parent current-post-parent menu-item-20867" id="menu-item-20867">
          <a href="http://dataunion.org/category/tech/base" title="base">
           基础架构
          </a>
         </li>
         <li class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-3302" id="menu-item-3302">
          <a href="http://dataunion.org/category/tech/ai" title="ai">
           人工智能
          </a>
         </li>
         <li class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-3303" id="menu-item-3303">
          <a href="http://dataunion.org/category/tech/analysis" title="analysis">
           数据分析
          </a>
         </li>
         <li class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-21920" id="menu-item-21920">
          <a href="http://dataunion.org/category/tech/dm">
           数据挖掘
          </a>
         </li>
         <li class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-3314" id="menu-item-3314">
          <a href="http://dataunion.org/category/tech/viz" title="viz">
           可视化
          </a>
         </li>
         <li class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-3305" id="menu-item-3305">
          <a href="http://dataunion.org/category/tech/devl" title="devl">
           编程语言
          </a>
         </li>
        </ul>
       </li>
       <li class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-has-children menu-item-20876" id="menu-item-20876">
        <a href="http://dataunion.org/category/industry">
         行业
        </a>
        <ul class="sub-menu">
         <li class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-16328" id="menu-item-16328">
          <a href="http://dataunion.org/category/industry/case" title="case">
           行业应用
          </a>
         </li>
         <li class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-2112" id="menu-item-2112">
          <a href="http://dataunion.org/category/industry/demo" title="demo">
           Demo展示
          </a>
         </li>
         <li class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-21562" id="menu-item-21562">
          <a href="http://dataunion.org/category/industry/news">
           行业资讯
          </a>
         </li>
        </ul>
       </li>
       <li class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-311" id="menu-item-311">
        <a href="http://dataunion.org/category/sources" title="sources">
         资源
        </a>
       </li>
       <li class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-20870" id="menu-item-20870">
        <a href="http://dataunion.org/category/books" title="book">
         图书
        </a>
       </li>
       <li class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-21363" id="menu-item-21363">
        <a href="http://dataunion.org/category/training">
         课程
        </a>
       </li>
       <li class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-has-children menu-item-21853" id="menu-item-21853">
        <a href="http://dataunion.org/category/jobs">
         职位
        </a>
        <ul class="sub-menu">
         <li class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-22050" id="menu-item-22050">
          <a href="http://dataunion.org/category/career">
           职业规划
          </a>
         </li>
        </ul>
       </li>
      </ul>
     </nav>
     <!--header-nav-->
    </div>
   </header>
   <!--header-web-->
   <div id="main">
    <div id="soutab">
     <form action="http://dataunion.org/" class="search" method="get">
     </form>
    </div>
    <div id="container">
     <nav id="mbx">
      当前位置：
      <a href="http://dataunion.org">
       首页
      </a>
      &gt;
      <a href="http://dataunion.org/category/tech">
       文章
      </a>
      &gt;
      <a href="http://dataunion.org/category/tech/base">
       基础架构
      </a>
      &gt;  正文
     </nav>
     <!--mbx-->
     <article class="content">
      <header align="centre" class="contenttitle">
       <div class="mscc">
        <h1 class="mscctitle">
         <a href="http://dataunion.org/16514.html">
          MySQL索引原理及慢查询优化
         </a>
        </h1>
        <address class="msccaddress ">
         <em>
          1,807 次阅读 -
         </em>
         <a href="http://dataunion.org/category/tech/base" rel="category tag">
          基础架构
         </a>
        </address>
       </div>
      </header>
      <div class="content-text">
       <p>
        MySQL凭借着出色的性能、低廉的成本、丰富的资源，已经成为绝大多数互联网公司的首选关系型数据库。虽然性能出色，但所谓“好马配好鞍”，如何能够更好的使用它，已经成为开发工程师的必修课，我们经常会从职位描述上看到诸如“精通MySQL”、“SQL语句优化”、“了解数据库原理”等要求。我们知道一般的应用系统，读写比例在10:1左右，而且插入操作和一般的更新操作很少出现性能问题，遇到最多的，也是最容易出问题的，还是一些复杂的查询操作，所以查询语句的优化显然是重中之重。
        <br/>
        本人从13年7月份起，一直在美团核心业务系统部做慢查询的优化工作，共计十余个系统，累计解决和积累了上百个慢查询案例。随着业务的复杂性提升，遇到的问题千奇百怪，五花八门，匪夷所思。本文旨在以开发工程师的角度来解释数据库索引的原理和如何优化慢查询。
       </p>
       <h1 id="-">
        一个慢查询引发的思考
       </h1>
       <p>
       </p>
       <!-- Crayon Syntax Highlighter v_2.7.2_beta -->
       <div class="crayon-syntax crayon-theme-classic crayon-font-monaco crayon-os-pc print-yes notranslate" data-settings=" minimize scroll-mouseover" id="crayon-576865dd2cdec527652403" style=" margin-top: 12px; margin-bottom: 12px; font-size: 12px !important; line-height: 15px !important;">
        <div class="crayon-toolbar" data-settings=" mouseover overlay hide delay" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">
         <span class="crayon-title">
         </span>
         <div class="crayon-tools" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">
          <div class="crayon-button crayon-nums-button" title="切换是否显示行编号">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-plain-button" title="纯文本显示代码">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-wrap-button" title="切换自动换行">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-expand-button" title="点击展开代码">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-copy-button" title="复制代码">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-popup-button" title="在新窗口中显示代码">
           <div class="crayon-button-icon">
           </div>
          </div>
         </div>
        </div>
        <div class="crayon-info" style="min-height: 16.8px !important; line-height: 16.8px !important;">
        </div>
        <div class="crayon-plain-wrap">
         <textarea class="crayon-plain print-no" data-settings="dblclick" readonly="" style="-moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4; font-size: 12px !important; line-height: 15px !important;" wrap="soft">
          &lt;span class="operator"&gt;&lt;span class="keyword"&gt;select&lt;/span&gt;
   &lt;span class="aggregate"&gt;count&lt;/span&gt;(*) 
&lt;span class="keyword"&gt;from&lt;/span&gt;
   task 
&lt;span class="keyword"&gt;where&lt;/span&gt;
   status=&lt;span class="number"&gt;2&lt;/span&gt; 
   &lt;span class="keyword"&gt;and&lt;/span&gt; operator_id=&lt;span class="number"&gt;20839&lt;/span&gt; 
   &lt;span class="keyword"&gt;and&lt;/span&gt; operate_time&amp;gt;&lt;span class="number"&gt;1371169729&lt;/span&gt; 
   &lt;span class="keyword"&gt;and&lt;/span&gt; operate_time&amp;lt;&lt;span class="number"&gt;1371174603&lt;/span&gt; 
   &lt;span class="keyword"&gt;and&lt;/span&gt; type=&lt;span class="number"&gt;2&lt;/span&gt;;&lt;/span&gt;
         </textarea>
        </div>
        <div class="crayon-main" style="">
         <table class="crayon-table">
          <tbody>
           <tr class="crayon-row">
            <td class="crayon-nums " data-settings="show">
             <div class="crayon-nums-content" style="font-size: 12px !important; line-height: 15px !important;">
              <div class="crayon-num" data-line="crayon-576865dd2cdec527652403-1">
               1
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576865dd2cdec527652403-2">
               2
              </div>
              <div class="crayon-num" data-line="crayon-576865dd2cdec527652403-3">
               3
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576865dd2cdec527652403-4">
               4
              </div>
              <div class="crayon-num" data-line="crayon-576865dd2cdec527652403-5">
               5
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576865dd2cdec527652403-6">
               6
              </div>
              <div class="crayon-num" data-line="crayon-576865dd2cdec527652403-7">
               7
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576865dd2cdec527652403-8">
               8
              </div>
              <div class="crayon-num" data-line="crayon-576865dd2cdec527652403-9">
               9
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576865dd2cdec527652403-10">
               10
              </div>
             </div>
            </td>
            <td class="crayon-code">
             <div class="crayon-pre" style="font-size: 12px !important; line-height: 15px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;">
              <div class="crayon-line" id="crayon-576865dd2cdec527652403-1">
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "operator"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                select
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576865dd2cdec527652403-2">
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "aggregate"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                count
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-sy">
                (
               </span>
               <span class="crayon-o">
                *
               </span>
               <span class="crayon-sy">
                )
               </span>
               <span class="crayon-h">
               </span>
              </div>
              <div class="crayon-line" id="crayon-576865dd2cdec527652403-3">
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                from
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576865dd2cdec527652403-4">
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                task
               </span>
               <span class="crayon-h">
               </span>
              </div>
              <div class="crayon-line" id="crayon-576865dd2cdec527652403-5">
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                where
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576865dd2cdec527652403-6">
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                status
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                2
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
              </div>
              <div class="crayon-line" id="crayon-576865dd2cdec527652403-7">
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-st">
                and
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                operator_id
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                20839
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576865dd2cdec527652403-8">
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-st">
                and
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                operate_time
               </span>
               <span class="crayon-o">
                &amp;
               </span>
               <span class="crayon-v">
                gt
               </span>
               <span class="crayon-sy">
                ;
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                1371169729
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
              </div>
              <div class="crayon-line" id="crayon-576865dd2cdec527652403-9">
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-st">
                and
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                operate_time
               </span>
               <span class="crayon-o">
                &amp;
               </span>
               <span class="crayon-v">
                lt
               </span>
               <span class="crayon-sy">
                ;
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                1371174603
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576865dd2cdec527652403-10">
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-st">
                and
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                type
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                2
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-sy">
                ;
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
              </div>
             </div>
            </td>
           </tr>
          </tbody>
         </table>
        </div>
       </div>
       <!-- [Format Time: 0.0179 seconds] -->
       <p>
        系统使用者反应有一个功能越来越慢，于是工程师找到了上面的SQL。
        <br/>
        并且兴致冲冲的找到了我，“这个SQL需要优化，给我把每个字段都加上索引”
        <br/>
        我很惊讶，问道“为什么需要每个字段都加上索引？”
        <br/>
        “把查询的字段都加上索引会更快”工程师信心满满
        <br/>
        “这种情况完全可以建一个联合索引，因为是最左前缀匹配，所以operate_time需要放到最后，而且还需要把其他相关的查询都拿来，需要做一个综合评估。”
        <br/>
        “联合索引？最左前缀匹配？综合评估？”工程师不禁陷入了沉思。
        <br/>
        多数情况下，我们知道索引能够提高查询效率，但应该如何建立索引？索引的顺序如何？许多人却只知道大概。其实理解这些概念并不难，而且索引的原理远没有想象的那么复杂。
       </p>
       <h1 id="mysql-">
        MySQL索引原理
       </h1>
       <h2 id="-">
        索引目的
       </h2>
       <p>
        索引的目的在于提高查询效率，可以类比字典，如果要查“mysql”这个单词，我们肯定需要定位到m字母，然后从下往下找到y字母，再找到剩下的sql。如果没有索引，那么你可能需要把所有单词看一遍才能找到你想要的，如果我想找到m开头的单词呢？或者ze开头的单词呢？是不是觉得如果没有索引，这个事情根本无法完成？
       </p>
       <h2 id="-">
        索引原理
       </h2>
       <p>
        除了词典，生活中随处可见索引的例子，如火车站的车次表、图书的目录等。它们的原理都是一样的，通过不断的缩小想要获得数据的范围来筛选出最终想要的结果，同时把随机的事件变成顺序的事件，也就是我们总是通过同一种查找方式来锁定数据。
        <br/>
        数据库也是一样，但显然要复杂许多，因为不仅面临着等值查询，还有范围查询(&gt;、&lt;、between、in)、模糊查询(like)、并集查询(or)等等。数据库应该选择怎么样的方式来应对所有的问题呢？我们回想字典的例子，能不能把数据分成段，然后分段查询呢？最简单的如果1000条数据，1到100分成第一段，101到200分成第二段，201到300分成第三段……这样查第250条数据，只要找第三段就可以了，一下子去除了90%的无效数据。但如果是1千万的记录呢，分成几段比较好？稍有算法基础的同学会想到搜索树，其平均复杂度是lgN，具有不错的查询性能。但这里我们忽略了一个关键的问题，复杂度模型是基于每次相同的操作成本来考虑的，数据库实现比较复杂，数据保存在磁盘上，而为了提高性能，每次又可以把部分数据读入内存来计算，因为我们知道访问磁盘的成本大概是访问内存的十万倍左右，所以简单的搜索树难以满足复杂的应用场景。
       </p>
       <h3 id="-io-">
        磁盘IO与预读
       </h3>
       <p>
        前面提到了访问磁盘，那么这里先简单介绍一下磁盘IO和预读，磁盘读取数据靠的是机械运动，每次读取数据花费的时间可以分为寻道时间、旋转延迟、传输时间三个部分，寻道时间指的是磁臂移动到指定磁道所需要的时间，主流磁盘一般在5ms以下；旋转延迟就是我们经常听说的磁盘转速，比如一个磁盘7200转，表示每分钟能转7200次，也就是说1秒钟能转120次，旋转延迟就是1/120/2 = 4.17ms；传输时间指的是从磁盘读出或将数据写入磁盘的时间，一般在零点几毫秒，相对于前两个时间可以忽略不计。那么访问一次磁盘的时间，即一次磁盘IO的时间约等于5+4.17 = 9ms左右，听起来还挺不错的，但要知道一台500 -MIPS的机器每秒可以执行5亿条指令，因为指令依靠的是电的性质，换句话说执行一次IO的时间可以执行40万条指令，数据库动辄十万百万乃至千万级数据，每次9毫秒的时间，显然是个灾难。下图是计算机硬件延迟的对比图，供大家参考：
        <br/>
        <img src="http://dataunion.org/wp-content/uploads/2015/05/various-system-software-hardware-latencies.png"/>
        <br/>
        考虑到磁盘IO是非常高昂的操作，计算机操作系统做了一些优化，当一次IO时，不光把当前磁盘地址的数据，而是把相邻的数据也都读取到内存缓冲区内，因为局部预读性原理告诉我们，当计算机访问一个地址的数据的时候，与其相邻的数据也会很快被访问到。每一次IO读取的数据我们称之为一页(page)。具体一页有多大数据跟操作系统有关，一般为4k或8k，也就是我们读取一页内的数据时候，实际上才发生了一次IO，这个理论对于索引的数据结构设计非常有帮助。
       </p>
       <h3 id="-">
        索引的数据结构
       </h3>
       <p>
        前面讲了生活中索引的例子，索引的基本原理，数据库的复杂性，又讲了操作系统的相关知识，目的就是让大家了解，任何一种数据结构都不是凭空产生的，一定会有它的背景和使用场景，我们现在总结一下，我们需要这种数据结构能够做些什么，其实很简单，那就是：每次查找数据时把磁盘IO次数控制在一个很小的数量级，最好是常数数量级。那么我们就想到如果一个高度可控的多路搜索树是否能满足需求呢？就这样，b+树应运而生。
       </p>
       <h3 id="-b-">
        详解b+树
       </h3>
       <p>
        <img src="http://dataunion.org/wp-content/uploads/2015/05/btree.jpg"/>
        <br/>
        如上图，是一颗b+树，关于b+树的定义可以参见
        <a href="http://zh.wikipedia.org/wiki/B%2B%E6%A0%91">
         B+树
        </a>
        ，这里只说一些重点，浅蓝色的块我们称之为一个磁盘块，可以看到每个磁盘块包含几个数据项（深蓝色所示）和指针（黄色所示），如磁盘块1包含数据项17和35，包含指针P1、P2、P3，P1表示小于17的磁盘块，P2表示在17和35之间的磁盘块，P3表示大于35的磁盘块。真实的数据存在于叶子节点即3、5、9、10、13、15、28、29、36、60、75、79、90、99。非叶子节点只不存储真实的数据，只存储指引搜索方向的数据项，如17、35并不真实存在于数据表中。
       </p>
       <h3 id="b-">
        b+树的查找过程
       </h3>
       <p>
        如图所示，如果要查找数据项29，那么首先会把磁盘块1由磁盘加载到内存，此时发生一次IO，在内存中用二分查找确定29在17和35之间，锁定磁盘块1的P2指针，内存时间因为非常短（相比磁盘的IO）可以忽略不计，通过磁盘块1的P2指针的磁盘地址把磁盘块3由磁盘加载到内存，发生第二次IO，29在26和30之间，锁定磁盘块3的P2指针，通过指针加载磁盘块8到内存，发生第三次IO，同时内存中做二分查找找到29，结束查询，总计三次IO。真实的情况是，3层的b+树可以表示上百万的数据，如果上百万的数据查找只需要三次IO，性能提高将是巨大的，如果没有索引，每个数据项都要发生一次IO，那么总共需要百万次的IO，显然成本非常非常高。
       </p>
       <h3 id="b-">
        b+树性质
       </h3>
       <p>
        1.通过上面的分析，我们知道IO次数取决于b+数的高度h，假设当前数据表的数据为N，每个磁盘块的数据项的数量是m，则有h=㏒(m+1)N，当数据量N一定的情况下，m越大，h越小；而m = 磁盘块的大小 / 数据项的大小，磁盘块的大小也就是一个数据页的大小，是固定的，如果数据项占的空间越小，数据项的数量越多，树的高度越低。这就是为什么每个数据项，即索引字段要尽量的小，比如int占4字节，要比bigint8字节少一半。这也是为什么b+树要求把真实的数据放到叶子节点而不是内层节点，一旦放到内层节点，磁盘块的数据项会大幅度下降，导致树增高。当数据项等于1时将会退化成线性表。
        <br/>
        2.当b+树的数据项是复合的数据结构，比如(name,age,sex)的时候，b+数是按照从左到右的顺序来建立搜索树的，比如当(张三,20,F)这样的数据来检索的时候，b+树会优先比较name来确定下一步的所搜方向，如果name相同再依次比较age和sex，最后得到检索的数据；但当(20,F)这样的没有name的数据来的时候，b+树就不知道下一步该查哪个节点，因为建立搜索树的时候name就是第一个比较因子，必须要先根据name来搜索才能知道下一步去哪里查询。比如当(张三,F)这样的数据来检索时，b+树可以用name来指定搜索方向，但下一个字段age的缺失，所以只能把名字等于张三的数据都找到，然后再匹配性别是F的数据了， 这个是非常重要的性质，即索引的最左匹配特性。
       </p>
       <h1 id="-">
        慢查询优化
       </h1>
       <p>
        关于MySQL索引原理是比较枯燥的东西，大家只需要有一个感性的认识，并不需要理解得非常透彻和深入。我们回头来看看一开始我们说的慢查询，了解完索引原理之后，大家是不是有什么想法呢？先总结一下索引的几大基本原则
       </p>
       <h2 id="-">
        建索引的几大原则
       </h2>
       <p>
        1.最左前缀匹配原则，非常重要的原则，mysql会一直向右匹配直到遇到范围查询(&gt;、&lt;、between、like)就停止匹配，比如a = 1 and b = 2 and c &gt; 3 and d = 4 如果建立(a,b,c,d)顺序的索引，d是用不到索引的，如果建立(a,b,d,c)的索引则都可以用到，a,b,d的顺序可以任意调整。
        <br/>
        2.=和in可以乱序，比如a = 1 and b = 2 and c = 3 建立(a,b,c)索引可以任意顺序，mysql的查询优化器会帮你优化成索引可以识别的形式
        <br/>
        3.尽量选择区分度高的列作为索引,区分度的公式是count(distinct col)/count(*)，表示字段不重复的比例，比例越大我们扫描的记录数越少，唯一键的区分度是1，而一些状态、性别字段可能在大数据面前区分度就是0，那可能有人会问，这个比例有什么经验值吗？使用场景不同，这个值也很难确定，一般需要join的字段我们都要求是0.1以上，即平均1条扫描10条记录
        <br/>
        4.索引列不能参与计算，保持列“干净”，比如from_unixtime(create_time) = ’2014-05-29’就不能使用到索引，原因很简单，b+树中存的都是数据表中的字段值，但进行检索时，需要把所有元素都应用函数才能比较，显然成本太大。所以语句应该写成create_time = unix_timestamp(’2014-05-29’);
        <br/>
        5.尽量的扩展索引，不要新建索引。比如表中已经有a的索引，现在要加(a,b)的索引，那么只需要修改原来的索引即可
       </p>
       <h2 id="-">
        回到开始的慢查询
       </h2>
       <p>
        根据最左匹配原则，最开始的sql语句的索引应该是status、operator_id、type、operate_time的联合索引；其中status、operator_id、type的顺序可以颠倒，所以我才会说，把这个表的所有相关查询都找到，会综合分析；
        <br/>
        比如还有如下查询
       </p>
       <!-- Crayon Syntax Highlighter v_2.7.2_beta -->
       <div class="crayon-syntax crayon-theme-classic crayon-font-monaco crayon-os-pc print-yes notranslate" data-settings=" minimize scroll-mouseover" id="crayon-576865dd2ce08685919877" style=" margin-top: 12px; margin-bottom: 12px; font-size: 12px !important; line-height: 15px !important;">
        <div class="crayon-toolbar" data-settings=" mouseover overlay hide delay" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">
         <span class="crayon-title">
         </span>
         <div class="crayon-tools" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">
          <div class="crayon-button crayon-nums-button" title="切换是否显示行编号">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-plain-button" title="纯文本显示代码">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-wrap-button" title="切换自动换行">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-expand-button" title="点击展开代码">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-copy-button" title="复制代码">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-popup-button" title="在新窗口中显示代码">
           <div class="crayon-button-icon">
           </div>
          </div>
         </div>
        </div>
        <div class="crayon-info" style="min-height: 16.8px !important; line-height: 16.8px !important;">
        </div>
        <div class="crayon-plain-wrap">
         <textarea class="crayon-plain print-no" data-settings="dblclick" readonly="" style="-moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4; font-size: 12px !important; line-height: 15px !important;" wrap="soft">
          &lt;span class="operator"&gt;&lt;span class="keyword"&gt;select&lt;/span&gt; * &lt;span class="keyword"&gt;from&lt;/span&gt; task &lt;span class="keyword"&gt;where&lt;/span&gt; status = &lt;span class="number"&gt;0&lt;/span&gt; &lt;span class="keyword"&gt;and&lt;/span&gt; type = &lt;span class="number"&gt;12&lt;/span&gt; limit &lt;span class="number"&gt;10&lt;/span&gt;;&lt;/span&gt;
         </textarea>
        </div>
        <div class="crayon-main" style="">
         <table class="crayon-table">
          <tbody>
           <tr class="crayon-row">
            <td class="crayon-nums " data-settings="show">
             <div class="crayon-nums-content" style="font-size: 12px !important; line-height: 15px !important;">
              <div class="crayon-num" data-line="crayon-576865dd2ce08685919877-1">
               1
              </div>
             </div>
            </td>
            <td class="crayon-code">
             <div class="crayon-pre" style="font-size: 12px !important; line-height: 15px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;">
              <div class="crayon-line" id="crayon-576865dd2ce08685919877-1">
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "operator"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                select
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                *
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                from
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                task
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                where
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                status
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                0
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-st">
                and
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                type
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                12
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                limit
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                10
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-sy">
                ;
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
              </div>
             </div>
            </td>
           </tr>
          </tbody>
         </table>
        </div>
       </div>
       <!-- [Format Time: 0.0113 seconds] -->
       <p>
       </p>
       <!-- Crayon Syntax Highlighter v_2.7.2_beta -->
       <div class="crayon-syntax crayon-theme-classic crayon-font-monaco crayon-os-pc print-yes notranslate" data-settings=" minimize scroll-mouseover" id="crayon-576865dd2ce0f524355010" style=" margin-top: 12px; margin-bottom: 12px; font-size: 12px !important; line-height: 15px !important;">
        <div class="crayon-toolbar" data-settings=" mouseover overlay hide delay" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">
         <span class="crayon-title">
         </span>
         <div class="crayon-tools" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">
          <div class="crayon-button crayon-nums-button" title="切换是否显示行编号">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-plain-button" title="纯文本显示代码">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-wrap-button" title="切换自动换行">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-expand-button" title="点击展开代码">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-copy-button" title="复制代码">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-popup-button" title="在新窗口中显示代码">
           <div class="crayon-button-icon">
           </div>
          </div>
         </div>
        </div>
        <div class="crayon-info" style="min-height: 16.8px !important; line-height: 16.8px !important;">
        </div>
        <div class="crayon-plain-wrap">
         <textarea class="crayon-plain print-no" data-settings="dblclick" readonly="" style="-moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4; font-size: 12px !important; line-height: 15px !important;" wrap="soft">
          &lt;span class="operator"&gt;&lt;span class="keyword"&gt;select&lt;/span&gt; &lt;span class="aggregate"&gt;count&lt;/span&gt;(*) &lt;span class="keyword"&gt;from&lt;/span&gt; task &lt;span class="keyword"&gt;where&lt;/span&gt; status = &lt;span class="number"&gt;0&lt;/span&gt; ;&lt;/span&gt;
         </textarea>
        </div>
        <div class="crayon-main" style="">
         <table class="crayon-table">
          <tbody>
           <tr class="crayon-row">
            <td class="crayon-nums " data-settings="show">
             <div class="crayon-nums-content" style="font-size: 12px !important; line-height: 15px !important;">
              <div class="crayon-num" data-line="crayon-576865dd2ce0f524355010-1">
               1
              </div>
             </div>
            </td>
            <td class="crayon-code">
             <div class="crayon-pre" style="font-size: 12px !important; line-height: 15px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;">
              <div class="crayon-line" id="crayon-576865dd2ce0f524355010-1">
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "operator"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                select
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "aggregate"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                count
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-sy">
                (
               </span>
               <span class="crayon-o">
                *
               </span>
               <span class="crayon-sy">
                )
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                from
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                task
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                where
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                status
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                0
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-sy">
                ;
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
              </div>
             </div>
            </td>
           </tr>
          </tbody>
         </table>
        </div>
       </div>
       <!-- [Format Time: 0.0032 seconds] -->
       <p>
        那么索引建立成(status,type,operator_id,operate_time)就是非常正确的，因为可以覆盖到所有情况。这个就是利用了索引的最左匹配的原则
       </p>
       <h2 id="-explain-">
        查询优化神器 – explain命令
       </h2>
       <p>
        关于explain命令相信大家并不陌生，具体用法和字段含义可以参考官网
        <a href="http://dev.mysql.com/doc/refman/5.5/en/explain-output.html">
         explain-output
        </a>
        ，这里需要强调rows是核心指标，绝大部分rows小的语句执行一定很快（有例外，下面会讲到）。所以优化语句基本上都是在优化rows。
       </p>
       <h2 id="-">
        慢查询优化基本步骤
       </h2>
       <p>
        0.先运行看看是否真的很慢，注意设置SQL_NO_CACHE
        <br/>
        1.where条件单表查，锁定最小返回记录表。这句话的意思是把查询语句的where都应用到表中返回的记录数最小的表开始查起，单表每个字段分别查询，看哪个字段的区分度最高
        <br/>
        2.explain查看执行计划，是否与1预期一致（从锁定记录较少的表开始查询）
        <br/>
        3.order by limit 形式的sql语句让排序的表优先查
        <br/>
        4.了解业务方使用场景
        <br/>
        5.加索引时参照建索引的几大原则
        <br/>
        6.观察结果，不符合预期继续从0分析
       </p>
       <h2 id="-">
        几个慢查询案例
       </h2>
       <p>
        下面几个例子详细解释了如何分析和优化慢查询
       </p>
       <h3 id="-">
        复杂语句写法
       </h3>
       <p>
        很多情况下，我们写SQL只是为了实现功能，这只是第一步，不同的语句书写方式对于效率往往有本质的差别，这要求我们对mysql的执行计划和索引原则有非常清楚的认识，请看下面的语句
       </p>
       <!-- Crayon Syntax Highlighter v_2.7.2_beta -->
       <div class="crayon-syntax crayon-theme-classic crayon-font-monaco crayon-os-pc print-yes notranslate" data-settings=" minimize scroll-mouseover" id="crayon-576865dd2ce17821116670" style=" margin-top: 12px; margin-bottom: 12px; font-size: 12px !important; line-height: 15px !important;">
        <div class="crayon-toolbar" data-settings=" mouseover overlay hide delay" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">
         <span class="crayon-title">
         </span>
         <div class="crayon-tools" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">
          <div class="crayon-button crayon-nums-button" title="切换是否显示行编号">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-plain-button" title="纯文本显示代码">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-wrap-button" title="切换自动换行">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-expand-button" title="点击展开代码">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-copy-button" title="复制代码">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-popup-button" title="在新窗口中显示代码">
           <div class="crayon-button-icon">
           </div>
          </div>
         </div>
        </div>
        <div class="crayon-info" style="min-height: 16.8px !important; line-height: 16.8px !important;">
        </div>
        <div class="crayon-plain-wrap">
         <textarea class="crayon-plain print-no" data-settings="dblclick" readonly="" style="-moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4; font-size: 12px !important; line-height: 15px !important;" wrap="soft">
          &lt;span class="operator"&gt;&lt;span class="keyword"&gt;select&lt;/span&gt;
   &lt;span class="keyword"&gt;distinct&lt;/span&gt; cert.emp_id 
&lt;span class="keyword"&gt;from&lt;/span&gt;
   cm_log cl 
&lt;span class="keyword"&gt;inner&lt;/span&gt; &lt;span class="keyword"&gt;join&lt;/span&gt;
   (
      &lt;span class="keyword"&gt;select&lt;/span&gt;
         emp.id &lt;span class="keyword"&gt;as&lt;/span&gt; emp_id,
         emp_cert.id &lt;span class="keyword"&gt;as&lt;/span&gt; cert_id 
      &lt;span class="keyword"&gt;from&lt;/span&gt;
         employee emp 
      &lt;span class="keyword"&gt;left&lt;/span&gt; &lt;span class="keyword"&gt;join&lt;/span&gt;
         emp_certificate emp_cert 
            &lt;span class="keyword"&gt;on&lt;/span&gt; emp.id = emp_cert.emp_id 
      &lt;span class="keyword"&gt;where&lt;/span&gt;
         emp.is_deleted=&lt;span class="number"&gt;0&lt;/span&gt;
   ) cert 
      &lt;span class="keyword"&gt;on&lt;/span&gt; (
         cl.ref_table=&lt;span class="string"&gt;'Employee'&lt;/span&gt; 
         &lt;span class="keyword"&gt;and&lt;/span&gt; cl.ref_oid= cert.emp_id
      ) 
      &lt;span class="keyword"&gt;or&lt;/span&gt; (
         cl.ref_table=&lt;span class="string"&gt;'EmpCertificate'&lt;/span&gt; 
         &lt;span class="keyword"&gt;and&lt;/span&gt; cl.ref_oid= cert.cert_id
      ) 
&lt;span class="keyword"&gt;where&lt;/span&gt;
   cl.last_upd_date &amp;gt;=&lt;span class="string"&gt;'2013-11-07 15:03:00'&lt;/span&gt; 
   &lt;span class="keyword"&gt;and&lt;/span&gt; cl.last_upd_date&amp;lt;=&lt;span class="string"&gt;'2013-11-08 16:00:00'&lt;/span&gt;;&lt;/span&gt;
         </textarea>
        </div>
        <div class="crayon-main" style="">
         <table class="crayon-table">
          <tbody>
           <tr class="crayon-row">
            <td class="crayon-nums " data-settings="show">
             <div class="crayon-nums-content" style="font-size: 12px !important; line-height: 15px !important;">
              <div class="crayon-num" data-line="crayon-576865dd2ce17821116670-1">
               1
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576865dd2ce17821116670-2">
               2
              </div>
              <div class="crayon-num" data-line="crayon-576865dd2ce17821116670-3">
               3
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576865dd2ce17821116670-4">
               4
              </div>
              <div class="crayon-num" data-line="crayon-576865dd2ce17821116670-5">
               5
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576865dd2ce17821116670-6">
               6
              </div>
              <div class="crayon-num" data-line="crayon-576865dd2ce17821116670-7">
               7
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576865dd2ce17821116670-8">
               8
              </div>
              <div class="crayon-num" data-line="crayon-576865dd2ce17821116670-9">
               9
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576865dd2ce17821116670-10">
               10
              </div>
              <div class="crayon-num" data-line="crayon-576865dd2ce17821116670-11">
               11
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576865dd2ce17821116670-12">
               12
              </div>
              <div class="crayon-num" data-line="crayon-576865dd2ce17821116670-13">
               13
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576865dd2ce17821116670-14">
               14
              </div>
              <div class="crayon-num" data-line="crayon-576865dd2ce17821116670-15">
               15
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576865dd2ce17821116670-16">
               16
              </div>
              <div class="crayon-num" data-line="crayon-576865dd2ce17821116670-17">
               17
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576865dd2ce17821116670-18">
               18
              </div>
              <div class="crayon-num" data-line="crayon-576865dd2ce17821116670-19">
               19
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576865dd2ce17821116670-20">
               20
              </div>
              <div class="crayon-num" data-line="crayon-576865dd2ce17821116670-21">
               21
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576865dd2ce17821116670-22">
               22
              </div>
              <div class="crayon-num" data-line="crayon-576865dd2ce17821116670-23">
               23
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576865dd2ce17821116670-24">
               24
              </div>
              <div class="crayon-num" data-line="crayon-576865dd2ce17821116670-25">
               25
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576865dd2ce17821116670-26">
               26
              </div>
              <div class="crayon-num" data-line="crayon-576865dd2ce17821116670-27">
               27
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576865dd2ce17821116670-28">
               28
              </div>
             </div>
            </td>
            <td class="crayon-code">
             <div class="crayon-pre" style="font-size: 12px !important; line-height: 15px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;">
              <div class="crayon-line" id="crayon-576865dd2ce17821116670-1">
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "operator"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                select
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576865dd2ce17821116670-2">
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                distinct
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                cert
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                emp_id
               </span>
               <span class="crayon-h">
               </span>
              </div>
              <div class="crayon-line" id="crayon-576865dd2ce17821116670-3">
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                from
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576865dd2ce17821116670-4">
               <span class="crayon-h">
               </span>
               <span class="crayon-e">
                cm_log
               </span>
               <span class="crayon-v">
                cl
               </span>
               <span class="crayon-h">
               </span>
              </div>
              <div class="crayon-line" id="crayon-576865dd2ce17821116670-5">
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                inner
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                join
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576865dd2ce17821116670-6">
               <span class="crayon-h">
               </span>
               <span class="crayon-sy">
                (
               </span>
              </div>
              <div class="crayon-line" id="crayon-576865dd2ce17821116670-7">
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                select
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576865dd2ce17821116670-8">
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                emp
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                id
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-st">
                as
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                emp_id
               </span>
               <span class="crayon-sy">
                ,
               </span>
              </div>
              <div class="crayon-line" id="crayon-576865dd2ce17821116670-9">
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                emp_cert
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                id
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-st">
                as
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                cert_id
               </span>
               <span class="crayon-h">
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576865dd2ce17821116670-10">
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                from
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
              </div>
              <div class="crayon-line" id="crayon-576865dd2ce17821116670-11">
               <span class="crayon-h">
               </span>
               <span class="crayon-e">
                employee
               </span>
               <span class="crayon-v">
                emp
               </span>
               <span class="crayon-h">
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576865dd2ce17821116670-12">
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                left
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                join
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
              </div>
              <div class="crayon-line" id="crayon-576865dd2ce17821116670-13">
               <span class="crayon-h">
               </span>
               <span class="crayon-e">
                emp_certificate
               </span>
               <span class="crayon-v">
                emp_cert
               </span>
               <span class="crayon-h">
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576865dd2ce17821116670-14">
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                on
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                emp
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                id
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                emp_cert
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                emp_id
               </span>
               <span class="crayon-h">
               </span>
              </div>
              <div class="crayon-line" id="crayon-576865dd2ce17821116670-15">
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                where
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576865dd2ce17821116670-16">
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                emp
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                is_deleted
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                0
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
              </div>
              <div class="crayon-line" id="crayon-576865dd2ce17821116670-17">
               <span class="crayon-h">
               </span>
               <span class="crayon-sy">
                )
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                cert
               </span>
               <span class="crayon-h">
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576865dd2ce17821116670-18">
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                on
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-sy">
                (
               </span>
              </div>
              <div class="crayon-line" id="crayon-576865dd2ce17821116670-19">
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                cl
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                ref_table
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "string"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-s">
                'Employee'
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576865dd2ce17821116670-20">
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-st">
                and
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                cl
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                ref_oid
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                cert
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                emp
               </span>
               <span class="crayon-sy">
                _
               </span>
               id
              </div>
              <div class="crayon-line" id="crayon-576865dd2ce17821116670-21">
               <span class="crayon-h">
               </span>
               <span class="crayon-sy">
                )
               </span>
               <span class="crayon-h">
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576865dd2ce17821116670-22">
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-st">
                or
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-sy">
                (
               </span>
              </div>
              <div class="crayon-line" id="crayon-576865dd2ce17821116670-23">
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                cl
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                ref_table
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "string"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-s">
                'EmpCertificate'
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576865dd2ce17821116670-24">
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-st">
                and
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                cl
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                ref_oid
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                cert
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                cert
               </span>
               <span class="crayon-sy">
                _
               </span>
               id
              </div>
              <div class="crayon-line" id="crayon-576865dd2ce17821116670-25">
               <span class="crayon-h">
               </span>
               <span class="crayon-sy">
                )
               </span>
               <span class="crayon-h">
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576865dd2ce17821116670-26">
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                where
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
              </div>
              <div class="crayon-line" id="crayon-576865dd2ce17821116670-27">
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                cl
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                last_upd_date
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &amp;
               </span>
               <span class="crayon-v">
                gt
               </span>
               <span class="crayon-sy">
                ;
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "string"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-s">
                '2013-11-07 15:03:00'
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576865dd2ce17821116670-28">
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-st">
                and
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                cl
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                last_upd_date
               </span>
               <span class="crayon-o">
                &amp;
               </span>
               <span class="crayon-v">
                lt
               </span>
               <span class="crayon-sy">
                ;
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "string"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-s">
                '2013-11-08 16:00:00'
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-sy">
                ;
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
              </div>
             </div>
            </td>
           </tr>
          </tbody>
         </table>
        </div>
       </div>
       <!-- [Format Time: 0.0300 seconds] -->
       <p>
        0.先运行一下，53条记录 1.87秒，又没有用聚合语句，比较慢
       </p>
       <!-- Crayon Syntax Highlighter v_2.7.2_beta -->
       <div class="crayon-syntax crayon-theme-classic crayon-font-monaco crayon-os-pc print-yes notranslate" data-settings=" minimize scroll-mouseover" id="crayon-576865dd2ce1f049344005" style=" margin-top: 12px; margin-bottom: 12px; font-size: 12px !important; line-height: 15px !important;">
        <div class="crayon-toolbar" data-settings=" mouseover overlay hide delay" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">
         <span class="crayon-title">
         </span>
         <div class="crayon-tools" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">
          <div class="crayon-button crayon-nums-button" title="切换是否显示行编号">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-plain-button" title="纯文本显示代码">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-wrap-button" title="切换自动换行">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-expand-button" title="点击展开代码">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-copy-button" title="复制代码">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-popup-button" title="在新窗口中显示代码">
           <div class="crayon-button-icon">
           </div>
          </div>
         </div>
        </div>
        <div class="crayon-info" style="min-height: 16.8px !important; line-height: 16.8px !important;">
        </div>
        <div class="crayon-plain-wrap">
         <textarea class="crayon-plain print-no" data-settings="dblclick" readonly="" style="-moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4; font-size: 12px !important; line-height: 15px !important;" wrap="soft">
          53 rows in &lt;span class="operator"&gt;&lt;span class="keyword"&gt;set&lt;/span&gt; (&lt;span class="number"&gt;1.87&lt;/span&gt; sec)&lt;/span&gt;
         </textarea>
        </div>
        <div class="crayon-main" style="">
         <table class="crayon-table">
          <tbody>
           <tr class="crayon-row">
            <td class="crayon-nums " data-settings="show">
             <div class="crayon-nums-content" style="font-size: 12px !important; line-height: 15px !important;">
              <div class="crayon-num" data-line="crayon-576865dd2ce1f049344005-1">
               1
              </div>
             </div>
            </td>
            <td class="crayon-code">
             <div class="crayon-pre" style="font-size: 12px !important; line-height: 15px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;">
              <div class="crayon-line" id="crayon-576865dd2ce1f049344005-1">
               <span class="crayon-cn">
                53
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-e">
                rows
               </span>
               <span class="crayon-st">
                in
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "operator"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                set
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-sy">
                (
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                1.87
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                sec
               </span>
               <span class="crayon-sy">
                )
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
              </div>
             </div>
            </td>
           </tr>
          </tbody>
         </table>
        </div>
       </div>
       <!-- [Format Time: 0.0018 seconds] -->
       <p>
        1.explain
       </p>
       <!-- Crayon Syntax Highlighter v_2.7.2_beta -->
       <div class="crayon-syntax crayon-theme-classic crayon-font-monaco crayon-os-pc print-yes notranslate" data-settings=" minimize scroll-mouseover" id="crayon-576865dd2ce25363288715" style=" margin-top: 12px; margin-bottom: 12px; font-size: 12px !important; line-height: 15px !important;">
        <div class="crayon-toolbar" data-settings=" mouseover overlay hide delay" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">
         <span class="crayon-title">
         </span>
         <div class="crayon-tools" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">
          <div class="crayon-button crayon-nums-button" title="切换是否显示行编号">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-plain-button" title="纯文本显示代码">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-wrap-button" title="切换自动换行">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-expand-button" title="点击展开代码">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-copy-button" title="复制代码">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-popup-button" title="在新窗口中显示代码">
           <div class="crayon-button-icon">
           </div>
          </div>
         </div>
        </div>
        <div class="crayon-info" style="min-height: 16.8px !important; line-height: 16.8px !important;">
        </div>
        <div class="crayon-plain-wrap">
         <textarea class="crayon-plain print-no" data-settings="dblclick" readonly="" style="-moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4; font-size: 12px !important; line-height: 15px !important;" wrap="soft">
          +----+-------------+------------+-------+---------------------------------+-----------------------+---------+-------------------+-------+--------------------------------+
| id | select_type | table      | type  | possible_keys                   | key                   | key_len | ref               | rows  | Extra                          |
+----+-------------+------------+-------+---------------------------------+-----------------------+---------+-------------------+-------+--------------------------------+
|  1 | PRIMARY     | cl         | range | cm_log_cls_id,idx_last_upd_date | idx_last_upd_date     | 8       | NULL              |   379 | Using where; Using temporary   |
|  1 | PRIMARY     | &amp;lt;derived2&amp;gt; | ALL   | NULL                            | NULL                  | NULL    | NULL              | 63727 | Using where; Using join buffer |
|  2 | DERIVED     | emp        | ALL   | NULL                            | NULL                  | NULL    | NULL              | 13317 | Using where                    |
|  2 | DERIVED     | emp_cert   | ref   | emp_certificate_empid           | emp_certificate_empid | 4       | meituanorg.emp.id |     1 | Using index                    |
+----+-------------+------------+-------+---------------------------------+-----------------------+---------+-------------------+-------+--------------------------------+
         </textarea>
        </div>
        <div class="crayon-main" style="">
         <table class="crayon-table">
          <tbody>
           <tr class="crayon-row">
            <td class="crayon-nums " data-settings="show">
             <div class="crayon-nums-content" style="font-size: 12px !important; line-height: 15px !important;">
              <div class="crayon-num" data-line="crayon-576865dd2ce25363288715-1">
               1
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576865dd2ce25363288715-2">
               2
              </div>
              <div class="crayon-num" data-line="crayon-576865dd2ce25363288715-3">
               3
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576865dd2ce25363288715-4">
               4
              </div>
              <div class="crayon-num" data-line="crayon-576865dd2ce25363288715-5">
               5
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576865dd2ce25363288715-6">
               6
              </div>
              <div class="crayon-num" data-line="crayon-576865dd2ce25363288715-7">
               7
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576865dd2ce25363288715-8">
               8
              </div>
             </div>
            </td>
            <td class="crayon-code">
             <div class="crayon-pre" style="font-size: 12px !important; line-height: 15px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;">
              <div class="crayon-line" id="crayon-576865dd2ce25363288715-1">
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                +
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576865dd2ce25363288715-2">
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                id
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                select_type
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                table
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                type
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                possible_keys
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                key
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                key_len
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                ref
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                rows
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                Extra
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
              </div>
              <div class="crayon-line" id="crayon-576865dd2ce25363288715-3">
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                +
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576865dd2ce25363288715-4">
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-cn">
                1
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                PRIMARY
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                cl
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                range
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                cm_log_cls_id
               </span>
               <span class="crayon-sy">
                ,
               </span>
               <span class="crayon-v">
                idx_last_upd_date
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                idx_last_upd_date
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-cn">
                8
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-t">
                NULL
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-cn">
                379
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-e">
                Using
               </span>
               <span class="crayon-v">
                where
               </span>
               <span class="crayon-sy">
                ;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-e">
                Using
               </span>
               <span class="crayon-v">
                temporary
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
              </div>
              <div class="crayon-line" id="crayon-576865dd2ce25363288715-5">
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-cn">
                1
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                PRIMARY
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &amp;
               </span>
               <span class="crayon-v">
                lt
               </span>
               <span class="crayon-sy">
                ;
               </span>
               <span class="crayon-v">
                derived2
               </span>
               <span class="crayon-o">
                &amp;
               </span>
               <span class="crayon-v">
                gt
               </span>
               <span class="crayon-sy">
                ;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                ALL
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-t">
                NULL
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-t">
                NULL
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-t">
                NULL
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-t">
                NULL
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-cn">
                63727
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-e">
                Using
               </span>
               <span class="crayon-v">
                where
               </span>
               <span class="crayon-sy">
                ;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-e">
                Using
               </span>
               <span class="crayon-e">
                join
               </span>
               <span class="crayon-v">
                buffer
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576865dd2ce25363288715-6">
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-cn">
                2
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                DERIVED
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                emp
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                ALL
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-t">
                NULL
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-t">
                NULL
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-t">
                NULL
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-t">
                NULL
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-cn">
                13317
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-e">
                Using
               </span>
               <span class="crayon-v">
                where
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
              </div>
              <div class="crayon-line" id="crayon-576865dd2ce25363288715-7">
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-cn">
                2
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                DERIVED
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                emp_cert
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                ref
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                emp_certificate_empid
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                emp_certificate_empid
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-cn">
                4
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                meituanorg
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                emp
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                id
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-cn">
                1
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-e">
                Using
               </span>
               <span class="crayon-v">
                index
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576865dd2ce25363288715-8">
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                +
               </span>
              </div>
             </div>
            </td>
           </tr>
          </tbody>
         </table>
        </div>
       </div>
       <!-- [Format Time: 0.0174 seconds] -->
       <p>
        简述一下执行计划，首先mysql根据idx_last_upd_date索引扫描cm_log表获得379条记录；然后查表扫描了63727条记录，分为两部分，derived表示构造表，也就是不存在的表，可以简单理解成是一个语句形成的结果集，后面的数字表示语句的ID。derived2表示的是ID = 2的查询构造了虚拟表，并且返回了63727条记录。我们再来看看ID = 2的语句究竟做了写什么返回了这么大量的数据，首先全表扫描employee表13317条记录，然后根据索引emp_certificate_empid关联emp_certificate表，rows = 1表示，每个关联都只锁定了一条记录，效率比较高。获得后，再和cm_log的379条记录根据规则关联。从执行过程上可以看出返回了太多的数据，返回的数据绝大部分cm_log都用不到，因为cm_log只锁定了379条记录。
        <br/>
        如何优化呢？可以看到我们在运行完后还是要和cm_log做join,那么我们能不能之前和cm_log做join呢？仔细分析语句不难发现，其基本思想是如果cm_log的ref_table是EmpCertificate就关联emp_certificate表，如果ref_table是Employee就关联employee表，我们完全可以拆成两部分，并用union连接起来，注意这里用union，而不用union all是因为原语句有“distinct”来得到唯一的记录，而union恰好具备了这种功能。如果原语句中没有distinct不需要去重，我们就可以直接使用union all了，因为使用union需要去重的动作，会影响SQL性能。
        <br/>
        优化过的语句如下
       </p>
       <!-- Crayon Syntax Highlighter v_2.7.2_beta -->
       <div class="crayon-syntax crayon-theme-classic crayon-font-monaco crayon-os-pc print-yes notranslate" data-settings=" minimize scroll-mouseover" id="crayon-576865dd2ce2d354813442" style=" margin-top: 12px; margin-bottom: 12px; font-size: 12px !important; line-height: 15px !important;">
        <div class="crayon-toolbar" data-settings=" mouseover overlay hide delay" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">
         <span class="crayon-title">
         </span>
         <div class="crayon-tools" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">
          <div class="crayon-button crayon-nums-button" title="切换是否显示行编号">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-plain-button" title="纯文本显示代码">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-wrap-button" title="切换自动换行">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-expand-button" title="点击展开代码">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-copy-button" title="复制代码">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-popup-button" title="在新窗口中显示代码">
           <div class="crayon-button-icon">
           </div>
          </div>
         </div>
        </div>
        <div class="crayon-info" style="min-height: 16.8px !important; line-height: 16.8px !important;">
        </div>
        <div class="crayon-plain-wrap">
         <textarea class="crayon-plain print-no" data-settings="dblclick" readonly="" style="-moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4; font-size: 12px !important; line-height: 15px !important;" wrap="soft">
          &lt;span class="operator"&gt;&lt;span class="keyword"&gt;select&lt;/span&gt;
   emp.id 
&lt;span class="keyword"&gt;from&lt;/span&gt;
   cm_log cl 
&lt;span class="keyword"&gt;inner&lt;/span&gt; &lt;span class="keyword"&gt;join&lt;/span&gt;
   employee emp 
      &lt;span class="keyword"&gt;on&lt;/span&gt; cl.ref_table = &lt;span class="string"&gt;'Employee'&lt;/span&gt; 
      &lt;span class="keyword"&gt;and&lt;/span&gt; cl.ref_oid = emp.id  
&lt;span class="keyword"&gt;where&lt;/span&gt;
   cl.last_upd_date &amp;gt;=&lt;span class="string"&gt;'2013-11-07 15:03:00'&lt;/span&gt; 
   &lt;span class="keyword"&gt;and&lt;/span&gt; cl.last_upd_date&amp;lt;=&lt;span class="string"&gt;'2013-11-08 16:00:00'&lt;/span&gt; 
   &lt;span class="keyword"&gt;and&lt;/span&gt; emp.is_deleted = &lt;span class="number"&gt;0&lt;/span&gt;  
&lt;span class="keyword"&gt;union&lt;/span&gt;
&lt;span class="keyword"&gt;select&lt;/span&gt;
   emp.id 
&lt;span class="keyword"&gt;from&lt;/span&gt;
   cm_log cl 
&lt;span class="keyword"&gt;inner&lt;/span&gt; &lt;span class="keyword"&gt;join&lt;/span&gt;
   emp_certificate ec 
      &lt;span class="keyword"&gt;on&lt;/span&gt; cl.ref_table = &lt;span class="string"&gt;'EmpCertificate'&lt;/span&gt; 
      &lt;span class="keyword"&gt;and&lt;/span&gt; cl.ref_oid = ec.id  
&lt;span class="keyword"&gt;inner&lt;/span&gt; &lt;span class="keyword"&gt;join&lt;/span&gt;
   employee emp 
      &lt;span class="keyword"&gt;on&lt;/span&gt; emp.id = ec.emp_id  
&lt;span class="keyword"&gt;where&lt;/span&gt;
   cl.last_upd_date &amp;gt;=&lt;span class="string"&gt;'2013-11-07 15:03:00'&lt;/span&gt; 
   &lt;span class="keyword"&gt;and&lt;/span&gt; cl.last_upd_date&amp;lt;=&lt;span class="string"&gt;'2013-11-08 16:00:00'&lt;/span&gt; 
   &lt;span class="keyword"&gt;and&lt;/span&gt; emp.is_deleted = &lt;span class="number"&gt;0&lt;/span&gt;&lt;/span&gt;
         </textarea>
        </div>
        <div class="crayon-main" style="">
         <table class="crayon-table">
          <tbody>
           <tr class="crayon-row">
            <td class="crayon-nums " data-settings="show">
             <div class="crayon-nums-content" style="font-size: 12px !important; line-height: 15px !important;">
              <div class="crayon-num" data-line="crayon-576865dd2ce2d354813442-1">
               1
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576865dd2ce2d354813442-2">
               2
              </div>
              <div class="crayon-num" data-line="crayon-576865dd2ce2d354813442-3">
               3
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576865dd2ce2d354813442-4">
               4
              </div>
              <div class="crayon-num" data-line="crayon-576865dd2ce2d354813442-5">
               5
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576865dd2ce2d354813442-6">
               6
              </div>
              <div class="crayon-num" data-line="crayon-576865dd2ce2d354813442-7">
               7
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576865dd2ce2d354813442-8">
               8
              </div>
              <div class="crayon-num" data-line="crayon-576865dd2ce2d354813442-9">
               9
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576865dd2ce2d354813442-10">
               10
              </div>
              <div class="crayon-num" data-line="crayon-576865dd2ce2d354813442-11">
               11
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576865dd2ce2d354813442-12">
               12
              </div>
              <div class="crayon-num" data-line="crayon-576865dd2ce2d354813442-13">
               13
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576865dd2ce2d354813442-14">
               14
              </div>
              <div class="crayon-num" data-line="crayon-576865dd2ce2d354813442-15">
               15
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576865dd2ce2d354813442-16">
               16
              </div>
              <div class="crayon-num" data-line="crayon-576865dd2ce2d354813442-17">
               17
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576865dd2ce2d354813442-18">
               18
              </div>
              <div class="crayon-num" data-line="crayon-576865dd2ce2d354813442-19">
               19
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576865dd2ce2d354813442-20">
               20
              </div>
              <div class="crayon-num" data-line="crayon-576865dd2ce2d354813442-21">
               21
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576865dd2ce2d354813442-22">
               22
              </div>
              <div class="crayon-num" data-line="crayon-576865dd2ce2d354813442-23">
               23
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576865dd2ce2d354813442-24">
               24
              </div>
              <div class="crayon-num" data-line="crayon-576865dd2ce2d354813442-25">
               25
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576865dd2ce2d354813442-26">
               26
              </div>
              <div class="crayon-num" data-line="crayon-576865dd2ce2d354813442-27">
               27
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576865dd2ce2d354813442-28">
               28
              </div>
             </div>
            </td>
            <td class="crayon-code">
             <div class="crayon-pre" style="font-size: 12px !important; line-height: 15px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;">
              <div class="crayon-line" id="crayon-576865dd2ce2d354813442-1">
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "operator"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                select
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576865dd2ce2d354813442-2">
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                emp
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                id
               </span>
               <span class="crayon-h">
               </span>
              </div>
              <div class="crayon-line" id="crayon-576865dd2ce2d354813442-3">
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                from
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576865dd2ce2d354813442-4">
               <span class="crayon-h">
               </span>
               <span class="crayon-e">
                cm_log
               </span>
               <span class="crayon-v">
                cl
               </span>
               <span class="crayon-h">
               </span>
              </div>
              <div class="crayon-line" id="crayon-576865dd2ce2d354813442-5">
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                inner
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                join
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576865dd2ce2d354813442-6">
               <span class="crayon-h">
               </span>
               <span class="crayon-e">
                employee
               </span>
               <span class="crayon-v">
                emp
               </span>
               <span class="crayon-h">
               </span>
              </div>
              <div class="crayon-line" id="crayon-576865dd2ce2d354813442-7">
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                on
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                cl
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                ref_table
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "string"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-s">
                'Employee'
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576865dd2ce2d354813442-8">
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-st">
                and
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                cl
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                ref_oid
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                emp
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                id
               </span>
               <span class="crayon-h">
               </span>
              </div>
              <div class="crayon-line" id="crayon-576865dd2ce2d354813442-9">
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                where
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576865dd2ce2d354813442-10">
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                cl
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                last_upd_date
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &amp;
               </span>
               <span class="crayon-v">
                gt
               </span>
               <span class="crayon-sy">
                ;
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "string"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-s">
                '2013-11-07 15:03:00'
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
              </div>
              <div class="crayon-line" id="crayon-576865dd2ce2d354813442-11">
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-st">
                and
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                cl
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                last_upd_date
               </span>
               <span class="crayon-o">
                &amp;
               </span>
               <span class="crayon-v">
                lt
               </span>
               <span class="crayon-sy">
                ;
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "string"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-s">
                '2013-11-08 16:00:00'
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576865dd2ce2d354813442-12">
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-st">
                and
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                emp
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                is_deleted
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                0
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
              </div>
              <div class="crayon-line" id="crayon-576865dd2ce2d354813442-13">
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                union
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576865dd2ce2d354813442-14">
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                select
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
              </div>
              <div class="crayon-line" id="crayon-576865dd2ce2d354813442-15">
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                emp
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                id
               </span>
               <span class="crayon-h">
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576865dd2ce2d354813442-16">
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                from
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
              </div>
              <div class="crayon-line" id="crayon-576865dd2ce2d354813442-17">
               <span class="crayon-h">
               </span>
               <span class="crayon-e">
                cm_log
               </span>
               <span class="crayon-v">
                cl
               </span>
               <span class="crayon-h">
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576865dd2ce2d354813442-18">
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                inner
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                join
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
              </div>
              <div class="crayon-line" id="crayon-576865dd2ce2d354813442-19">
               <span class="crayon-h">
               </span>
               <span class="crayon-e">
                emp_certificate
               </span>
               <span class="crayon-v">
                ec
               </span>
               <span class="crayon-h">
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576865dd2ce2d354813442-20">
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                on
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                cl
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                ref_table
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "string"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-s">
                'EmpCertificate'
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
              </div>
              <div class="crayon-line" id="crayon-576865dd2ce2d354813442-21">
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-st">
                and
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                cl
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                ref_oid
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                ec
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                id
               </span>
               <span class="crayon-h">
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576865dd2ce2d354813442-22">
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                inner
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                join
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
              </div>
              <div class="crayon-line" id="crayon-576865dd2ce2d354813442-23">
               <span class="crayon-h">
               </span>
               <span class="crayon-e">
                employee
               </span>
               <span class="crayon-v">
                emp
               </span>
               <span class="crayon-h">
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576865dd2ce2d354813442-24">
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                on
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                emp
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                id
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                ec
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                emp_id
               </span>
               <span class="crayon-h">
               </span>
              </div>
              <div class="crayon-line" id="crayon-576865dd2ce2d354813442-25">
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                where
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576865dd2ce2d354813442-26">
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                cl
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                last_upd_date
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &amp;
               </span>
               <span class="crayon-v">
                gt
               </span>
               <span class="crayon-sy">
                ;
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "string"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-s">
                '2013-11-07 15:03:00'
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
              </div>
              <div class="crayon-line" id="crayon-576865dd2ce2d354813442-27">
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-st">
                and
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                cl
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                last_upd_date
               </span>
               <span class="crayon-o">
                &amp;
               </span>
               <span class="crayon-v">
                lt
               </span>
               <span class="crayon-sy">
                ;
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "string"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-s">
                '2013-11-08 16:00:00'
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576865dd2ce2d354813442-28">
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-st">
                and
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                emp
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                is_deleted
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                0
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
              </div>
             </div>
            </td>
           </tr>
          </tbody>
         </table>
        </div>
       </div>
       <!-- [Format Time: 0.0169 seconds] -->
       <p>
        4.不需要了解业务场景，只需要改造的语句和改造之前的语句保持结果一致
       </p>
       <p>
        5.现有索引可以满足，不需要建索引
       </p>
       <p>
        6.用改造后的语句实验一下，只需要10ms 降低了近200倍！
       </p>
       <!-- Crayon Syntax Highlighter v_2.7.2_beta -->
       <div class="crayon-syntax crayon-theme-classic crayon-font-monaco crayon-os-pc print-yes notranslate" data-settings=" minimize scroll-mouseover" id="crayon-576865dd2ce35858579705" style=" margin-top: 12px; margin-bottom: 12px; font-size: 12px !important; line-height: 15px !important;">
        <div class="crayon-toolbar" data-settings=" mouseover overlay hide delay" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">
         <span class="crayon-title">
         </span>
         <div class="crayon-tools" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">
          <div class="crayon-button crayon-nums-button" title="切换是否显示行编号">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-plain-button" title="纯文本显示代码">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-wrap-button" title="切换自动换行">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-expand-button" title="点击展开代码">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-copy-button" title="复制代码">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-popup-button" title="在新窗口中显示代码">
           <div class="crayon-button-icon">
           </div>
          </div>
         </div>
        </div>
        <div class="crayon-info" style="min-height: 16.8px !important; line-height: 16.8px !important;">
        </div>
        <div class="crayon-plain-wrap">
         <textarea class="crayon-plain print-no" data-settings="dblclick" readonly="" style="-moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4; font-size: 12px !important; line-height: 15px !important;" wrap="soft">
          +----+--------------+------------+--------+---------------------------------+-------------------+---------+-----------------------+------+-------------+
| id | select_type  | table      | type   | possible_keys                   | key               | key_len | ref                   | rows | Extra       |
+----+--------------+------------+--------+---------------------------------+-------------------+---------+-----------------------+------+-------------+
|  1 | PRIMARY      | cl         | range  | cm_log_cls_id,idx_last_upd_date | idx_last_upd_date | 8       | NULL                  |  379 | Using where |
|  1 | PRIMARY      | emp        | eq_ref | PRIMARY                         | PRIMARY           | 4       | meituanorg.cl.ref_oid |    1 | Using where |
|  2 | UNION        | cl         | range  | cm_log_cls_id,idx_last_upd_date | idx_last_upd_date | 8       | NULL                  |  379 | Using where |
|  2 | UNION        | ec         | eq_ref | PRIMARY,emp_certificate_empid   | PRIMARY           | 4       | meituanorg.cl.ref_oid |    1 |             |
|  2 | UNION        | emp        | eq_ref | PRIMARY                         | PRIMARY           | 4       | meituanorg.ec.emp_id  |    1 | Using where |
| NULL | UNION RESULT | &amp;lt;union1,2&amp;gt; | ALL    | NULL                            | NULL              | NULL    | NULL                  | NULL |             |
+----+--------------+------------+--------+---------------------------------+-------------------+---------+-----------------------+------+-------------+
53 rows in set (0.01 sec)
         </textarea>
        </div>
        <div class="crayon-main" style="">
         <table class="crayon-table">
          <tbody>
           <tr class="crayon-row">
            <td class="crayon-nums " data-settings="show">
             <div class="crayon-nums-content" style="font-size: 12px !important; line-height: 15px !important;">
              <div class="crayon-num" data-line="crayon-576865dd2ce35858579705-1">
               1
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576865dd2ce35858579705-2">
               2
              </div>
              <div class="crayon-num" data-line="crayon-576865dd2ce35858579705-3">
               3
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576865dd2ce35858579705-4">
               4
              </div>
              <div class="crayon-num" data-line="crayon-576865dd2ce35858579705-5">
               5
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576865dd2ce35858579705-6">
               6
              </div>
              <div class="crayon-num" data-line="crayon-576865dd2ce35858579705-7">
               7
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576865dd2ce35858579705-8">
               8
              </div>
              <div class="crayon-num" data-line="crayon-576865dd2ce35858579705-9">
               9
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576865dd2ce35858579705-10">
               10
              </div>
              <div class="crayon-num" data-line="crayon-576865dd2ce35858579705-11">
               11
              </div>
             </div>
            </td>
            <td class="crayon-code">
             <div class="crayon-pre" style="font-size: 12px !important; line-height: 15px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;">
              <div class="crayon-line" id="crayon-576865dd2ce35858579705-1">
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-o">
                +
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576865dd2ce35858579705-2">
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                id
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                select_type
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                table
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                type
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                possible_keys
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                key
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                key_len
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                ref
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                rows
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                Extra
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
              </div>
              <div class="crayon-line" id="crayon-576865dd2ce35858579705-3">
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-o">
                +
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576865dd2ce35858579705-4">
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-cn">
                1
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                PRIMARY
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                cl
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                range
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                cm_log_cls_id
               </span>
               <span class="crayon-sy">
                ,
               </span>
               <span class="crayon-v">
                idx_last_upd_date
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                idx_last_upd_date
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-cn">
                8
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-t">
                NULL
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-cn">
                379
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-e">
                Using
               </span>
               <span class="crayon-v">
                where
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
              </div>
              <div class="crayon-line" id="crayon-576865dd2ce35858579705-5">
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-cn">
                1
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                PRIMARY
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                emp
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                eq_ref
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                PRIMARY
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                PRIMARY
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-cn">
                4
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                meituanorg
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                cl
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                ref_oid
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-cn">
                1
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-e">
                Using
               </span>
               <span class="crayon-v">
                where
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576865dd2ce35858579705-6">
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-cn">
                2
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                UNION
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                cl
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                range
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                cm_log_cls_id
               </span>
               <span class="crayon-sy">
                ,
               </span>
               <span class="crayon-v">
                idx_last_upd_date
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                idx_last_upd_date
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-cn">
                8
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-t">
                NULL
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-cn">
                379
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-e">
                Using
               </span>
               <span class="crayon-v">
                where
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
              </div>
              <div class="crayon-line" id="crayon-576865dd2ce35858579705-7">
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-cn">
                2
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                UNION
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                ec
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                eq_ref
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                PRIMARY
               </span>
               <span class="crayon-sy">
                ,
               </span>
               <span class="crayon-v">
                emp_certificate_empid
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                PRIMARY
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-cn">
                4
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                meituanorg
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                cl
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                ref_oid
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-cn">
                1
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576865dd2ce35858579705-8">
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-cn">
                2
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                UNION
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                emp
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                eq_ref
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                PRIMARY
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                PRIMARY
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-cn">
                4
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                meituanorg
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                ec
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                emp_id
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-cn">
                1
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-e">
                Using
               </span>
               <span class="crayon-v">
                where
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
              </div>
              <div class="crayon-line" id="crayon-576865dd2ce35858579705-9">
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-t">
                NULL
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-e">
                UNION
               </span>
               <span class="crayon-v">
                RESULT
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &amp;
               </span>
               <span class="crayon-v">
                lt
               </span>
               <span class="crayon-sy">
                ;
               </span>
               <span class="crayon-v">
                union1
               </span>
               <span class="crayon-sy">
                ,
               </span>
               <span class="crayon-cn">
                2
               </span>
               <span class="crayon-o">
                &amp;
               </span>
               <span class="crayon-v">
                gt
               </span>
               <span class="crayon-sy">
                ;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                ALL
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-t">
                NULL
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-t">
                NULL
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-t">
                NULL
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-t">
                NULL
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-t">
                NULL
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576865dd2ce35858579705-10">
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-o">
                +
               </span>
              </div>
              <div class="crayon-line" id="crayon-576865dd2ce35858579705-11">
               <span class="crayon-cn">
                53
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-e">
                rows
               </span>
               <span class="crayon-st">
                in
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-e">
                set
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-sy">
                (
               </span>
               <span class="crayon-cn">
                0.01
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                sec
               </span>
               <span class="crayon-sy">
                )
               </span>
              </div>
             </div>
            </td>
           </tr>
          </tbody>
         </table>
        </div>
       </div>
       <!-- [Format Time: 0.0195 seconds] -->
       <p>
       </p>
       <h3 id="-">
        明确应用场景
       </h3>
       <p>
        举这个例子的目的在于颠覆我们对列的区分度的认知，一般上我们认为区分度越高的列，越容易锁定更少的记录，但在一些特殊的情况下，这种理论是有局限性的
       </p>
       <!-- Crayon Syntax Highlighter v_2.7.2_beta -->
       <div class="crayon-syntax crayon-theme-classic crayon-font-monaco crayon-os-pc print-yes notranslate" data-settings=" minimize scroll-mouseover" id="crayon-576865dd2ce3d757547351" style=" margin-top: 12px; margin-bottom: 12px; font-size: 12px !important; line-height: 15px !important;">
        <div class="crayon-toolbar" data-settings=" mouseover overlay hide delay" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">
         <span class="crayon-title">
         </span>
         <div class="crayon-tools" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">
          <div class="crayon-button crayon-nums-button" title="切换是否显示行编号">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-plain-button" title="纯文本显示代码">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-wrap-button" title="切换自动换行">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-expand-button" title="点击展开代码">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-copy-button" title="复制代码">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-popup-button" title="在新窗口中显示代码">
           <div class="crayon-button-icon">
           </div>
          </div>
         </div>
        </div>
        <div class="crayon-info" style="min-height: 16.8px !important; line-height: 16.8px !important;">
        </div>
        <div class="crayon-plain-wrap">
         <textarea class="crayon-plain print-no" data-settings="dblclick" readonly="" style="-moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4; font-size: 12px !important; line-height: 15px !important;" wrap="soft">
          &lt;span class="operator"&gt;&lt;span class="keyword"&gt;select&lt;/span&gt;
   * 
&lt;span class="keyword"&gt;from&lt;/span&gt;
   stage_poi sp 
&lt;span class="keyword"&gt;where&lt;/span&gt;
   sp.accurate_result=&lt;span class="number"&gt;1&lt;/span&gt; 
   &lt;span class="keyword"&gt;and&lt;/span&gt; (
      sp.sync_status=&lt;span class="number"&gt;0&lt;/span&gt; 
      &lt;span class="keyword"&gt;or&lt;/span&gt; sp.sync_status=&lt;span class="number"&gt;2&lt;/span&gt; 
      &lt;span class="keyword"&gt;or&lt;/span&gt; sp.sync_status=&lt;span class="number"&gt;4&lt;/span&gt;
   );&lt;/span&gt;
         </textarea>
        </div>
        <div class="crayon-main" style="">
         <table class="crayon-table">
          <tbody>
           <tr class="crayon-row">
            <td class="crayon-nums " data-settings="show">
             <div class="crayon-nums-content" style="font-size: 12px !important; line-height: 15px !important;">
              <div class="crayon-num" data-line="crayon-576865dd2ce3d757547351-1">
               1
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576865dd2ce3d757547351-2">
               2
              </div>
              <div class="crayon-num" data-line="crayon-576865dd2ce3d757547351-3">
               3
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576865dd2ce3d757547351-4">
               4
              </div>
              <div class="crayon-num" data-line="crayon-576865dd2ce3d757547351-5">
               5
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576865dd2ce3d757547351-6">
               6
              </div>
              <div class="crayon-num" data-line="crayon-576865dd2ce3d757547351-7">
               7
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576865dd2ce3d757547351-8">
               8
              </div>
              <div class="crayon-num" data-line="crayon-576865dd2ce3d757547351-9">
               9
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576865dd2ce3d757547351-10">
               10
              </div>
              <div class="crayon-num" data-line="crayon-576865dd2ce3d757547351-11">
               11
              </div>
             </div>
            </td>
            <td class="crayon-code">
             <div class="crayon-pre" style="font-size: 12px !important; line-height: 15px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;">
              <div class="crayon-line" id="crayon-576865dd2ce3d757547351-1">
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "operator"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                select
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576865dd2ce3d757547351-2">
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                *
               </span>
               <span class="crayon-h">
               </span>
              </div>
              <div class="crayon-line" id="crayon-576865dd2ce3d757547351-3">
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                from
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576865dd2ce3d757547351-4">
               <span class="crayon-h">
               </span>
               <span class="crayon-e">
                stage_poi
               </span>
               <span class="crayon-v">
                sp
               </span>
               <span class="crayon-h">
               </span>
              </div>
              <div class="crayon-line" id="crayon-576865dd2ce3d757547351-5">
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                where
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576865dd2ce3d757547351-6">
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                sp
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                accurate_result
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                1
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
              </div>
              <div class="crayon-line" id="crayon-576865dd2ce3d757547351-7">
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-st">
                and
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-sy">
                (
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576865dd2ce3d757547351-8">
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                sp
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                sync_status
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                0
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
              </div>
              <div class="crayon-line" id="crayon-576865dd2ce3d757547351-9">
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-st">
                or
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                sp
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                sync_status
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                2
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576865dd2ce3d757547351-10">
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-st">
                or
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                sp
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                sync_status
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                4
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
              </div>
              <div class="crayon-line" id="crayon-576865dd2ce3d757547351-11">
               <span class="crayon-h">
               </span>
               <span class="crayon-sy">
                )
               </span>
               <span class="crayon-sy">
                ;
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
              </div>
             </div>
            </td>
           </tr>
          </tbody>
         </table>
        </div>
       </div>
       <!-- [Format Time: 0.0056 seconds] -->
       <p>
        0.先看看运行多长时间,951条数据6.22秒，真的很慢
       </p>
       <!-- Crayon Syntax Highlighter v_2.7.2_beta -->
       <div class="crayon-syntax crayon-theme-classic crayon-font-monaco crayon-os-pc print-yes notranslate" data-settings=" minimize scroll-mouseover" id="crayon-576865dd2ce43487493986" style=" margin-top: 12px; margin-bottom: 12px; font-size: 12px !important; line-height: 15px !important;">
        <div class="crayon-toolbar" data-settings=" mouseover overlay hide delay" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">
         <span class="crayon-title">
         </span>
         <div class="crayon-tools" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">
          <div class="crayon-button crayon-nums-button" title="切换是否显示行编号">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-plain-button" title="纯文本显示代码">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-wrap-button" title="切换自动换行">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-expand-button" title="点击展开代码">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-copy-button" title="复制代码">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-popup-button" title="在新窗口中显示代码">
           <div class="crayon-button-icon">
           </div>
          </div>
         </div>
        </div>
        <div class="crayon-info" style="min-height: 16.8px !important; line-height: 16.8px !important;">
        </div>
        <div class="crayon-plain-wrap">
         <textarea class="crayon-plain print-no" data-settings="dblclick" readonly="" style="-moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4; font-size: 12px !important; line-height: 15px !important;" wrap="soft">
          951 rows in &lt;span class="operator"&gt;&lt;span class="keyword"&gt;set&lt;/span&gt; (&lt;span class="number"&gt;6.22&lt;/span&gt; sec)&lt;/span&gt;
         </textarea>
        </div>
        <div class="crayon-main" style="">
         <table class="crayon-table">
          <tbody>
           <tr class="crayon-row">
            <td class="crayon-nums " data-settings="show">
             <div class="crayon-nums-content" style="font-size: 12px !important; line-height: 15px !important;">
              <div class="crayon-num" data-line="crayon-576865dd2ce43487493986-1">
               1
              </div>
             </div>
            </td>
            <td class="crayon-code">
             <div class="crayon-pre" style="font-size: 12px !important; line-height: 15px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;">
              <div class="crayon-line" id="crayon-576865dd2ce43487493986-1">
               <span class="crayon-cn">
                951
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-e">
                rows
               </span>
               <span class="crayon-st">
                in
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "operator"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                set
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-sy">
                (
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                6.22
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                sec
               </span>
               <span class="crayon-sy">
                )
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
              </div>
             </div>
            </td>
           </tr>
          </tbody>
         </table>
        </div>
       </div>
       <!-- [Format Time: 0.0017 seconds] -->
       <p>
        1.先explain，rows达到了361万，type = ALL表明是全表扫描
       </p>
       <!-- Crayon Syntax Highlighter v_2.7.2_beta -->
       <div class="crayon-syntax crayon-theme-classic crayon-font-monaco crayon-os-pc print-yes notranslate" data-settings=" minimize scroll-mouseover" id="crayon-576865dd2ce49496965984" style=" margin-top: 12px; margin-bottom: 12px; font-size: 12px !important; line-height: 15px !important;">
        <div class="crayon-toolbar" data-settings=" mouseover overlay hide delay" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">
         <span class="crayon-title">
         </span>
         <div class="crayon-tools" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">
          <div class="crayon-button crayon-nums-button" title="切换是否显示行编号">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-plain-button" title="纯文本显示代码">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-wrap-button" title="切换自动换行">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-expand-button" title="点击展开代码">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-copy-button" title="复制代码">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-popup-button" title="在新窗口中显示代码">
           <div class="crayon-button-icon">
           </div>
          </div>
         </div>
        </div>
        <div class="crayon-info" style="min-height: 16.8px !important; line-height: 16.8px !important;">
        </div>
        <div class="crayon-plain-wrap">
         <textarea class="crayon-plain print-no" data-settings="dblclick" readonly="" style="-moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4; font-size: 12px !important; line-height: 15px !important;" wrap="soft">
          +&lt;span class="comment"&gt;----+-------------+-------+------+---------------+------+---------+------+---------+-------------+&lt;/span&gt;
| id | select_type | table | type | possible_keys | key  | key_len | ref  | rows    | Extra       |
+&lt;span class="comment"&gt;----+-------------+-------+------+---------------+------+---------+------+---------+-------------+&lt;/span&gt;
|  1 | SIMPLE      | sp    | ALL  | NULL          | NULL | NULL    | NULL | 3613155 | Using where |
+&lt;span class="comment"&gt;----+-------------+-------+------+---------------+------+---------+------+---------+-------------+&lt;/span&gt;
         </textarea>
        </div>
        <div class="crayon-main" style="">
         <table class="crayon-table">
          <tbody>
           <tr class="crayon-row">
            <td class="crayon-nums " data-settings="show">
             <div class="crayon-nums-content" style="font-size: 12px !important; line-height: 15px !important;">
              <div class="crayon-num" data-line="crayon-576865dd2ce49496965984-1">
               1
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576865dd2ce49496965984-2">
               2
              </div>
              <div class="crayon-num" data-line="crayon-576865dd2ce49496965984-3">
               3
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576865dd2ce49496965984-4">
               4
              </div>
              <div class="crayon-num" data-line="crayon-576865dd2ce49496965984-5">
               5
              </div>
             </div>
            </td>
            <td class="crayon-code">
             <div class="crayon-pre" style="font-size: 12px !important; line-height: 15px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;">
              <div class="crayon-line" id="crayon-576865dd2ce49496965984-1">
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "comment"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576865dd2ce49496965984-2">
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                id
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                select_type
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                table
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                type
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                possible_keys
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                key
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                key_len
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                ref
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                rows
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                Extra
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
              </div>
              <div class="crayon-line" id="crayon-576865dd2ce49496965984-3">
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "comment"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576865dd2ce49496965984-4">
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-cn">
                1
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                SIMPLE
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                sp
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                ALL
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-t">
                NULL
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-t">
                NULL
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-t">
                NULL
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-t">
                NULL
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-cn">
                3613155
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-e">
                Using
               </span>
               <span class="crayon-v">
                where
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
              </div>
              <div class="crayon-line" id="crayon-576865dd2ce49496965984-5">
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "comment"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
              </div>
             </div>
            </td>
           </tr>
          </tbody>
         </table>
        </div>
       </div>
       <!-- [Format Time: 0.0095 seconds] -->
       <p>
        2.所有字段都应用查询返回记录数，因为是单表查询 0已经做过了951条
       </p>
       <p>
        3.让explain的rows 尽量逼近951
       </p>
       <p>
        看一下accurate_result = 1的记录数
       </p>
       <!-- Crayon Syntax Highlighter v_2.7.2_beta -->
       <div class="crayon-syntax crayon-theme-classic crayon-font-monaco crayon-os-pc print-yes notranslate" data-settings=" minimize scroll-mouseover" id="crayon-576865dd2ce4f978362986" style=" margin-top: 12px; margin-bottom: 12px; font-size: 12px !important; line-height: 15px !important;">
        <div class="crayon-toolbar" data-settings=" mouseover overlay hide delay" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">
         <span class="crayon-title">
         </span>
         <div class="crayon-tools" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">
          <div class="crayon-button crayon-nums-button" title="切换是否显示行编号">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-plain-button" title="纯文本显示代码">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-wrap-button" title="切换自动换行">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-expand-button" title="点击展开代码">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-copy-button" title="复制代码">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-popup-button" title="在新窗口中显示代码">
           <div class="crayon-button-icon">
           </div>
          </div>
         </div>
        </div>
        <div class="crayon-info" style="min-height: 16.8px !important; line-height: 16.8px !important;">
        </div>
        <div class="crayon-plain-wrap">
         <textarea class="crayon-plain print-no" data-settings="dblclick" readonly="" style="-moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4; font-size: 12px !important; line-height: 15px !important;" wrap="soft">
          &lt;span class="operator"&gt;&lt;span class="keyword"&gt;select&lt;/span&gt; &lt;span class="aggregate"&gt;count&lt;/span&gt;(*),accurate_result &lt;span class="keyword"&gt;from&lt;/span&gt; stage_poi  &lt;span class="keyword"&gt;group&lt;/span&gt; &lt;span class="keyword"&gt;by&lt;/span&gt; accurate_result;&lt;/span&gt;
+&lt;span class="comment"&gt;----------+-----------------+&lt;/span&gt;
| count(*) | accurate_result |
+&lt;span class="comment"&gt;----------+-----------------+&lt;/span&gt;
|     1023 |              -1 |
|  2114655 |               0 |
|   972815 |               1 |
+&lt;span class="comment"&gt;----------+-----------------+&lt;/span&gt;
         </textarea>
        </div>
        <div class="crayon-main" style="">
         <table class="crayon-table">
          <tbody>
           <tr class="crayon-row">
            <td class="crayon-nums " data-settings="show">
             <div class="crayon-nums-content" style="font-size: 12px !important; line-height: 15px !important;">
              <div class="crayon-num" data-line="crayon-576865dd2ce4f978362986-1">
               1
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576865dd2ce4f978362986-2">
               2
              </div>
              <div class="crayon-num" data-line="crayon-576865dd2ce4f978362986-3">
               3
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576865dd2ce4f978362986-4">
               4
              </div>
              <div class="crayon-num" data-line="crayon-576865dd2ce4f978362986-5">
               5
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576865dd2ce4f978362986-6">
               6
              </div>
              <div class="crayon-num" data-line="crayon-576865dd2ce4f978362986-7">
               7
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576865dd2ce4f978362986-8">
               8
              </div>
             </div>
            </td>
            <td class="crayon-code">
             <div class="crayon-pre" style="font-size: 12px !important; line-height: 15px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;">
              <div class="crayon-line" id="crayon-576865dd2ce4f978362986-1">
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "operator"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                select
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "aggregate"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                count
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-sy">
                (
               </span>
               <span class="crayon-o">
                *
               </span>
               <span class="crayon-sy">
                )
               </span>
               <span class="crayon-sy">
                ,
               </span>
               <span class="crayon-v">
                accurate_result
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                from
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                stage_poi
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                group
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                by
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                accurate_result
               </span>
               <span class="crayon-sy">
                ;
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576865dd2ce4f978362986-2">
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "comment"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
              </div>
              <div class="crayon-line" id="crayon-576865dd2ce4f978362986-3">
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-e">
                count
               </span>
               <span class="crayon-sy">
                (
               </span>
               <span class="crayon-o">
                *
               </span>
               <span class="crayon-sy">
                )
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                accurate_result
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576865dd2ce4f978362986-4">
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "comment"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
              </div>
              <div class="crayon-line" id="crayon-576865dd2ce4f978362986-5">
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-cn">
                1023
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-cn">
                1
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576865dd2ce4f978362986-6">
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-cn">
                2114655
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-cn">
                0
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
              </div>
              <div class="crayon-line" id="crayon-576865dd2ce4f978362986-7">
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-cn">
                972815
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-cn">
                1
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576865dd2ce4f978362986-8">
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "comment"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
              </div>
             </div>
            </td>
           </tr>
          </tbody>
         </table>
        </div>
       </div>
       <!-- [Format Time: 0.0073 seconds] -->
       <p>
        我们看到accurate_result这个字段的区分度非常低，整个表只有-1,0,1三个值，加上索引也无法锁定特别少量的数据
       </p>
       <p>
        再看一下sync_status字段的情况
       </p>
       <!-- Crayon Syntax Highlighter v_2.7.2_beta -->
       <div class="crayon-syntax crayon-theme-classic crayon-font-monaco crayon-os-pc print-yes notranslate" data-settings=" minimize scroll-mouseover" id="crayon-576865dd2ce56806872090" style=" margin-top: 12px; margin-bottom: 12px; font-size: 12px !important; line-height: 15px !important;">
        <div class="crayon-toolbar" data-settings=" mouseover overlay hide delay" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">
         <span class="crayon-title">
         </span>
         <div class="crayon-tools" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">
          <div class="crayon-button crayon-nums-button" title="切换是否显示行编号">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-plain-button" title="纯文本显示代码">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-wrap-button" title="切换自动换行">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-expand-button" title="点击展开代码">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-copy-button" title="复制代码">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-popup-button" title="在新窗口中显示代码">
           <div class="crayon-button-icon">
           </div>
          </div>
         </div>
        </div>
        <div class="crayon-info" style="min-height: 16.8px !important; line-height: 16.8px !important;">
        </div>
        <div class="crayon-plain-wrap">
         <textarea class="crayon-plain print-no" data-settings="dblclick" readonly="" style="-moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4; font-size: 12px !important; line-height: 15px !important;" wrap="soft">
          &lt;span class="operator"&gt;&lt;span class="keyword"&gt;select&lt;/span&gt; &lt;span class="aggregate"&gt;count&lt;/span&gt;(*),sync_status &lt;span class="keyword"&gt;from&lt;/span&gt; stage_poi  &lt;span class="keyword"&gt;group&lt;/span&gt; &lt;span class="keyword"&gt;by&lt;/span&gt; sync_status;&lt;/span&gt;
+&lt;span class="comment"&gt;----------+-------------+&lt;/span&gt;
| count(*) | sync_status |
+&lt;span class="comment"&gt;----------+-------------+&lt;/span&gt;
|     3080 |           0 |
|  3085413 |           3 |
+&lt;span class="comment"&gt;----------+-------------+&lt;/span&gt;
         </textarea>
        </div>
        <div class="crayon-main" style="">
         <table class="crayon-table">
          <tbody>
           <tr class="crayon-row">
            <td class="crayon-nums " data-settings="show">
             <div class="crayon-nums-content" style="font-size: 12px !important; line-height: 15px !important;">
              <div class="crayon-num" data-line="crayon-576865dd2ce56806872090-1">
               1
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576865dd2ce56806872090-2">
               2
              </div>
              <div class="crayon-num" data-line="crayon-576865dd2ce56806872090-3">
               3
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576865dd2ce56806872090-4">
               4
              </div>
              <div class="crayon-num" data-line="crayon-576865dd2ce56806872090-5">
               5
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576865dd2ce56806872090-6">
               6
              </div>
              <div class="crayon-num" data-line="crayon-576865dd2ce56806872090-7">
               7
              </div>
             </div>
            </td>
            <td class="crayon-code">
             <div class="crayon-pre" style="font-size: 12px !important; line-height: 15px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;">
              <div class="crayon-line" id="crayon-576865dd2ce56806872090-1">
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "operator"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                select
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "aggregate"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                count
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-sy">
                (
               </span>
               <span class="crayon-o">
                *
               </span>
               <span class="crayon-sy">
                )
               </span>
               <span class="crayon-sy">
                ,
               </span>
               <span class="crayon-v">
                sync_status
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                from
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                stage_poi
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                group
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                by
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                sync_status
               </span>
               <span class="crayon-sy">
                ;
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576865dd2ce56806872090-2">
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "comment"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
              </div>
              <div class="crayon-line" id="crayon-576865dd2ce56806872090-3">
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-e">
                count
               </span>
               <span class="crayon-sy">
                (
               </span>
               <span class="crayon-o">
                *
               </span>
               <span class="crayon-sy">
                )
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                sync_status
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576865dd2ce56806872090-4">
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "comment"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
              </div>
              <div class="crayon-line" id="crayon-576865dd2ce56806872090-5">
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-cn">
                3080
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-cn">
                0
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576865dd2ce56806872090-6">
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-cn">
                3085413
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-cn">
                3
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
              </div>
              <div class="crayon-line" id="crayon-576865dd2ce56806872090-7">
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "comment"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
              </div>
             </div>
            </td>
           </tr>
          </tbody>
         </table>
        </div>
       </div>
       <!-- [Format Time: 0.0063 seconds] -->
       <p>
        同样的区分度也很低，根据理论，也不适合建立索引
       </p>
       <p>
        问题分析到这，好像得出了这个表无法优化的结论，两个列的区分度都很低，即便加上索引也只能适应这种情况，很难做普遍性的优化，比如当sync_status 0、3分布的很平均，那么锁定记录也是百万级别的
       </p>
       <p>
        4.找业务方去沟通，看看使用场景。业务方是这么来使用这个SQL语句的，每隔五分钟会扫描符合条件的数据，处理完成后把sync_status这个字段变成1,五分钟符合条件的记录数并不会太多，1000个左右。了解了业务方的使用场景后，优化这个SQL就变得简单了，因为业务方保证了数据的不平衡，如果加上索引可以过滤掉绝大部分不需要的数据
       </p>
       <p>
        5.根据建立索引规则，使用如下语句建立索引
       </p>
       <!-- Crayon Syntax Highlighter v_2.7.2_beta -->
       <div class="crayon-syntax crayon-theme-classic crayon-font-monaco crayon-os-pc print-yes notranslate" data-settings=" minimize scroll-mouseover" id="crayon-576865dd2ce5d123564425" style=" margin-top: 12px; margin-bottom: 12px; font-size: 12px !important; line-height: 15px !important;">
        <div class="crayon-toolbar" data-settings=" mouseover overlay hide delay" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">
         <span class="crayon-title">
         </span>
         <div class="crayon-tools" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">
          <div class="crayon-button crayon-nums-button" title="切换是否显示行编号">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-plain-button" title="纯文本显示代码">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-wrap-button" title="切换自动换行">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-expand-button" title="点击展开代码">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-copy-button" title="复制代码">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-popup-button" title="在新窗口中显示代码">
           <div class="crayon-button-icon">
           </div>
          </div>
         </div>
        </div>
        <div class="crayon-info" style="min-height: 16.8px !important; line-height: 16.8px !important;">
        </div>
        <div class="crayon-plain-wrap">
         <textarea class="crayon-plain print-no" data-settings="dblclick" readonly="" style="-moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4; font-size: 12px !important; line-height: 15px !important;" wrap="soft">
          &lt;span class="operator"&gt;&lt;span class="keyword"&gt;alter&lt;/span&gt; &lt;span class="keyword"&gt;table&lt;/span&gt; stage_poi &lt;span class="keyword"&gt;add&lt;/span&gt; index idx_acc_status(accurate_result,sync_status);&lt;/span&gt;
         </textarea>
        </div>
        <div class="crayon-main" style="">
         <table class="crayon-table">
          <tbody>
           <tr class="crayon-row">
            <td class="crayon-nums " data-settings="show">
             <div class="crayon-nums-content" style="font-size: 12px !important; line-height: 15px !important;">
              <div class="crayon-num" data-line="crayon-576865dd2ce5d123564425-1">
               1
              </div>
             </div>
            </td>
            <td class="crayon-code">
             <div class="crayon-pre" style="font-size: 12px !important; line-height: 15px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;">
              <div class="crayon-line" id="crayon-576865dd2ce5d123564425-1">
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "operator"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                alter
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                table
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                stage_poi
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                add
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-e">
                index
               </span>
               <span class="crayon-e">
                idx_acc_status
               </span>
               <span class="crayon-sy">
                (
               </span>
               <span class="crayon-v">
                accurate_result
               </span>
               <span class="crayon-sy">
                ,
               </span>
               <span class="crayon-v">
                sync_status
               </span>
               <span class="crayon-sy">
                )
               </span>
               <span class="crayon-sy">
                ;
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
              </div>
             </div>
            </td>
           </tr>
          </tbody>
         </table>
        </div>
       </div>
       <!-- [Format Time: 0.0023 seconds] -->
       <p>
        6.观察预期结果,发现只需要200ms，快了30多倍。
       </p>
       <!-- Crayon Syntax Highlighter v_2.7.2_beta -->
       <div class="crayon-syntax crayon-theme-classic crayon-font-monaco crayon-os-pc print-yes notranslate" data-settings=" minimize scroll-mouseover" id="crayon-576865dd2ce63131254465" style=" margin-top: 12px; margin-bottom: 12px; font-size: 12px !important; line-height: 15px !important;">
        <div class="crayon-toolbar" data-settings=" mouseover overlay hide delay" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">
         <span class="crayon-title">
         </span>
         <div class="crayon-tools" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">
          <div class="crayon-button crayon-nums-button" title="切换是否显示行编号">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-plain-button" title="纯文本显示代码">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-wrap-button" title="切换自动换行">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-expand-button" title="点击展开代码">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-copy-button" title="复制代码">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-popup-button" title="在新窗口中显示代码">
           <div class="crayon-button-icon">
           </div>
          </div>
         </div>
        </div>
        <div class="crayon-info" style="min-height: 16.8px !important; line-height: 16.8px !important;">
        </div>
        <div class="crayon-plain-wrap">
         <textarea class="crayon-plain print-no" data-settings="dblclick" readonly="" style="-moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4; font-size: 12px !important; line-height: 15px !important;" wrap="soft">
          952 rows in &lt;span class="operator"&gt;&lt;span class="keyword"&gt;set&lt;/span&gt; (&lt;span class="number"&gt;0.20&lt;/span&gt; sec)&lt;/span&gt;
         </textarea>
        </div>
        <div class="crayon-main" style="">
         <table class="crayon-table">
          <tbody>
           <tr class="crayon-row">
            <td class="crayon-nums " data-settings="show">
             <div class="crayon-nums-content" style="font-size: 12px !important; line-height: 15px !important;">
              <div class="crayon-num" data-line="crayon-576865dd2ce63131254465-1">
               1
              </div>
             </div>
            </td>
            <td class="crayon-code">
             <div class="crayon-pre" style="font-size: 12px !important; line-height: 15px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;">
              <div class="crayon-line" id="crayon-576865dd2ce63131254465-1">
               <span class="crayon-cn">
                952
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-e">
                rows
               </span>
               <span class="crayon-st">
                in
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "operator"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                set
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-sy">
                (
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                0.20
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                sec
               </span>
               <span class="crayon-sy">
                )
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
              </div>
             </div>
            </td>
           </tr>
          </tbody>
         </table>
        </div>
       </div>
       <!-- [Format Time: 0.0017 seconds] -->
       <p>
        我们再来回顾一下分析问题的过程，单表查询相对来说比较好优化，大部分时候只需要把where条件里面的字段依照规则加上索引就好，如果只是这种“无脑”优化的话，显然一些区分度非常低的列，不应该加索引的列也会被加上索引，这样会对插入、更新性能造成严重的影响，同时也有可能影响其它的查询语句。所以我们第4步调差SQL的使用场景非常关键，我们只有知道这个业务场景，才能更好地辅助我们更好的分析和优化查询语句。
       </p>
       <h3 id="-">
        无法优化的语句
       </h3>
       <p>
       </p>
       <!-- Crayon Syntax Highlighter v_2.7.2_beta -->
       <div class="crayon-syntax crayon-theme-classic crayon-font-monaco crayon-os-pc print-yes notranslate" data-settings=" minimize scroll-mouseover" id="crayon-576865dd2ce6a035901578" style=" margin-top: 12px; margin-bottom: 12px; font-size: 12px !important; line-height: 15px !important;">
        <div class="crayon-toolbar" data-settings=" mouseover overlay hide delay" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">
         <span class="crayon-title">
         </span>
         <div class="crayon-tools" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">
          <div class="crayon-button crayon-nums-button" title="切换是否显示行编号">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-plain-button" title="纯文本显示代码">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-wrap-button" title="切换自动换行">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-expand-button" title="点击展开代码">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-copy-button" title="复制代码">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-popup-button" title="在新窗口中显示代码">
           <div class="crayon-button-icon">
           </div>
          </div>
         </div>
        </div>
        <div class="crayon-info" style="min-height: 16.8px !important; line-height: 16.8px !important;">
        </div>
        <div class="crayon-plain-wrap">
         <textarea class="crayon-plain print-no" data-settings="dblclick" readonly="" style="-moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4; font-size: 12px !important; line-height: 15px !important;" wrap="soft">
          &lt;span class="operator"&gt;&lt;span class="keyword"&gt;select&lt;/span&gt;
   c.id,
   c.name,
   c.position,
   c.sex,
   c.phone,
   c.office_phone,
   c.feature_info,
   c.birthday,
   c.creator_id,
   c.is_keyperson,
   c.giveup_reason,
   c.status,
   c.data_source,
   from_unixtime(c.created_time) &lt;span class="keyword"&gt;as&lt;/span&gt; created_time,
   from_unixtime(c.last_modified) &lt;span class="keyword"&gt;as&lt;/span&gt; last_modified,
   c.last_modified_user_id  
&lt;span class="keyword"&gt;from&lt;/span&gt;
   contact c  
&lt;span class="keyword"&gt;inner&lt;/span&gt; &lt;span class="keyword"&gt;join&lt;/span&gt;
   contact_branch cb 
      &lt;span class="keyword"&gt;on&lt;/span&gt;  c.id = cb.contact_id  
&lt;span class="keyword"&gt;inner&lt;/span&gt; &lt;span class="keyword"&gt;join&lt;/span&gt;
   branch_user bu 
      &lt;span class="keyword"&gt;on&lt;/span&gt;  cb.branch_id = bu.branch_id 
      &lt;span class="keyword"&gt;and&lt;/span&gt; bu.status &lt;span class="keyword"&gt;in&lt;/span&gt; (
         &lt;span class="number"&gt;1&lt;/span&gt;,
      &lt;span class="number"&gt;2&lt;/span&gt;)  
   &lt;span class="keyword"&gt;inner&lt;/span&gt; &lt;span class="keyword"&gt;join&lt;/span&gt;
      org_emp_info oei 
         &lt;span class="keyword"&gt;on&lt;/span&gt;  oei.data_id = bu.user_id 
         &lt;span class="keyword"&gt;and&lt;/span&gt; oei.node_left &amp;gt;= &lt;span class="number"&gt;2875&lt;/span&gt; 
         &lt;span class="keyword"&gt;and&lt;/span&gt; oei.node_right &amp;lt;= &lt;span class="number"&gt;10802&lt;/span&gt; 
         &lt;span class="keyword"&gt;and&lt;/span&gt; oei.org_category = - &lt;span class="number"&gt;1&lt;/span&gt;  
   &lt;span class="keyword"&gt;order&lt;/span&gt; &lt;span class="keyword"&gt;by&lt;/span&gt;
      c.created_time &lt;span class="keyword"&gt;desc&lt;/span&gt;  limit &lt;span class="number"&gt;0&lt;/span&gt; ,
      &lt;span class="number"&gt;10&lt;/span&gt;;&lt;/span&gt;
         </textarea>
        </div>
        <div class="crayon-main" style="">
         <table class="crayon-table">
          <tbody>
           <tr class="crayon-row">
            <td class="crayon-nums " data-settings="show">
             <div class="crayon-nums-content" style="font-size: 12px !important; line-height: 15px !important;">
              <div class="crayon-num" data-line="crayon-576865dd2ce6a035901578-1">
               1
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576865dd2ce6a035901578-2">
               2
              </div>
              <div class="crayon-num" data-line="crayon-576865dd2ce6a035901578-3">
               3
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576865dd2ce6a035901578-4">
               4
              </div>
              <div class="crayon-num" data-line="crayon-576865dd2ce6a035901578-5">
               5
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576865dd2ce6a035901578-6">
               6
              </div>
              <div class="crayon-num" data-line="crayon-576865dd2ce6a035901578-7">
               7
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576865dd2ce6a035901578-8">
               8
              </div>
              <div class="crayon-num" data-line="crayon-576865dd2ce6a035901578-9">
               9
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576865dd2ce6a035901578-10">
               10
              </div>
              <div class="crayon-num" data-line="crayon-576865dd2ce6a035901578-11">
               11
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576865dd2ce6a035901578-12">
               12
              </div>
              <div class="crayon-num" data-line="crayon-576865dd2ce6a035901578-13">
               13
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576865dd2ce6a035901578-14">
               14
              </div>
              <div class="crayon-num" data-line="crayon-576865dd2ce6a035901578-15">
               15
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576865dd2ce6a035901578-16">
               16
              </div>
              <div class="crayon-num" data-line="crayon-576865dd2ce6a035901578-17">
               17
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576865dd2ce6a035901578-18">
               18
              </div>
              <div class="crayon-num" data-line="crayon-576865dd2ce6a035901578-19">
               19
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576865dd2ce6a035901578-20">
               20
              </div>
              <div class="crayon-num" data-line="crayon-576865dd2ce6a035901578-21">
               21
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576865dd2ce6a035901578-22">
               22
              </div>
              <div class="crayon-num" data-line="crayon-576865dd2ce6a035901578-23">
               23
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576865dd2ce6a035901578-24">
               24
              </div>
              <div class="crayon-num" data-line="crayon-576865dd2ce6a035901578-25">
               25
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576865dd2ce6a035901578-26">
               26
              </div>
              <div class="crayon-num" data-line="crayon-576865dd2ce6a035901578-27">
               27
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576865dd2ce6a035901578-28">
               28
              </div>
              <div class="crayon-num" data-line="crayon-576865dd2ce6a035901578-29">
               29
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576865dd2ce6a035901578-30">
               30
              </div>
              <div class="crayon-num" data-line="crayon-576865dd2ce6a035901578-31">
               31
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576865dd2ce6a035901578-32">
               32
              </div>
              <div class="crayon-num" data-line="crayon-576865dd2ce6a035901578-33">
               33
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576865dd2ce6a035901578-34">
               34
              </div>
              <div class="crayon-num" data-line="crayon-576865dd2ce6a035901578-35">
               35
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576865dd2ce6a035901578-36">
               36
              </div>
              <div class="crayon-num" data-line="crayon-576865dd2ce6a035901578-37">
               37
              </div>
             </div>
            </td>
            <td class="crayon-code">
             <div class="crayon-pre" style="font-size: 12px !important; line-height: 15px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;">
              <div class="crayon-line" id="crayon-576865dd2ce6a035901578-1">
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "operator"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                select
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576865dd2ce6a035901578-2">
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                c
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                id
               </span>
               <span class="crayon-sy">
                ,
               </span>
              </div>
              <div class="crayon-line" id="crayon-576865dd2ce6a035901578-3">
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                c
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                name
               </span>
               <span class="crayon-sy">
                ,
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576865dd2ce6a035901578-4">
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                c
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                position
               </span>
               <span class="crayon-sy">
                ,
               </span>
              </div>
              <div class="crayon-line" id="crayon-576865dd2ce6a035901578-5">
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                c
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                sex
               </span>
               <span class="crayon-sy">
                ,
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576865dd2ce6a035901578-6">
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                c
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                phone
               </span>
               <span class="crayon-sy">
                ,
               </span>
              </div>
              <div class="crayon-line" id="crayon-576865dd2ce6a035901578-7">
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                c
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                office_phone
               </span>
               <span class="crayon-sy">
                ,
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576865dd2ce6a035901578-8">
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                c
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                feature_info
               </span>
               <span class="crayon-sy">
                ,
               </span>
              </div>
              <div class="crayon-line" id="crayon-576865dd2ce6a035901578-9">
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                c
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                birthday
               </span>
               <span class="crayon-sy">
                ,
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576865dd2ce6a035901578-10">
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                c
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                creator_id
               </span>
               <span class="crayon-sy">
                ,
               </span>
              </div>
              <div class="crayon-line" id="crayon-576865dd2ce6a035901578-11">
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                c
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                is_keyperson
               </span>
               <span class="crayon-sy">
                ,
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576865dd2ce6a035901578-12">
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                c
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                giveup_reason
               </span>
               <span class="crayon-sy">
                ,
               </span>
              </div>
              <div class="crayon-line" id="crayon-576865dd2ce6a035901578-13">
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                c
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                status
               </span>
               <span class="crayon-sy">
                ,
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576865dd2ce6a035901578-14">
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                c
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                data_source
               </span>
               <span class="crayon-sy">
                ,
               </span>
              </div>
              <div class="crayon-line" id="crayon-576865dd2ce6a035901578-15">
               <span class="crayon-h">
               </span>
               <span class="crayon-e">
                from_unixtime
               </span>
               <span class="crayon-sy">
                (
               </span>
               <span class="crayon-v">
                c
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                created_time
               </span>
               <span class="crayon-sy">
                )
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-st">
                as
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                created_time
               </span>
               <span class="crayon-sy">
                ,
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576865dd2ce6a035901578-16">
               <span class="crayon-h">
               </span>
               <span class="crayon-e">
                from_unixtime
               </span>
               <span class="crayon-sy">
                (
               </span>
               <span class="crayon-v">
                c
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                last_modified
               </span>
               <span class="crayon-sy">
                )
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-st">
                as
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                last_modified
               </span>
               <span class="crayon-sy">
                ,
               </span>
              </div>
              <div class="crayon-line" id="crayon-576865dd2ce6a035901578-17">
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                c
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                last_modified_user_id
               </span>
               <span class="crayon-h">
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576865dd2ce6a035901578-18">
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                from
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
              </div>
              <div class="crayon-line" id="crayon-576865dd2ce6a035901578-19">
               <span class="crayon-h">
               </span>
               <span class="crayon-i">
                contact
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                c
               </span>
               <span class="crayon-h">
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576865dd2ce6a035901578-20">
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                inner
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                join
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
              </div>
              <div class="crayon-line" id="crayon-576865dd2ce6a035901578-21">
               <span class="crayon-h">
               </span>
               <span class="crayon-e">
                contact_branch
               </span>
               <span class="crayon-v">
                cb
               </span>
               <span class="crayon-h">
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576865dd2ce6a035901578-22">
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                on
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                c
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                id
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                cb
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                contact_id
               </span>
               <span class="crayon-h">
               </span>
              </div>
              <div class="crayon-line" id="crayon-576865dd2ce6a035901578-23">
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                inner
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                join
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576865dd2ce6a035901578-24">
               <span class="crayon-h">
               </span>
               <span class="crayon-e">
                branch_user
               </span>
               <span class="crayon-v">
                bu
               </span>
               <span class="crayon-h">
               </span>
              </div>
              <div class="crayon-line" id="crayon-576865dd2ce6a035901578-25">
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                on
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                cb
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                branch_id
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                bu
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                branch_id
               </span>
               <span class="crayon-h">
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576865dd2ce6a035901578-26">
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-st">
                and
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                bu
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                status
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-st">
                in
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-sy">
                (
               </span>
              </div>
              <div class="crayon-line" id="crayon-576865dd2ce6a035901578-27">
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                1
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-sy">
                ,
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576865dd2ce6a035901578-28">
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                2
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-sy">
                )
               </span>
               <span class="crayon-h">
               </span>
              </div>
              <div class="crayon-line" id="crayon-576865dd2ce6a035901578-29">
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                inner
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                join
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576865dd2ce6a035901578-30">
               <span class="crayon-h">
               </span>
               <span class="crayon-e">
                org_emp_info
               </span>
               <span class="crayon-v">
                oei
               </span>
               <span class="crayon-h">
               </span>
              </div>
              <div class="crayon-line" id="crayon-576865dd2ce6a035901578-31">
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                on
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                oei
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                data_id
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                bu
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                user_id
               </span>
               <span class="crayon-h">
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576865dd2ce6a035901578-32">
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-st">
                and
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                oei
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                node_left
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &amp;
               </span>
               <span class="crayon-v">
                gt
               </span>
               <span class="crayon-sy">
                ;
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                2875
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
              </div>
              <div class="crayon-line" id="crayon-576865dd2ce6a035901578-33">
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-st">
                and
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                oei
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                node_right
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &amp;
               </span>
               <span class="crayon-v">
                lt
               </span>
               <span class="crayon-sy">
                ;
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                10802
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576865dd2ce6a035901578-34">
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-st">
                and
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                oei
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                org_category
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                1
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
              </div>
              <div class="crayon-line" id="crayon-576865dd2ce6a035901578-35">
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                order
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                by
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576865dd2ce6a035901578-36">
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                c
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                created_time
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                desc
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                limit
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                0
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-sy">
                ,
               </span>
              </div>
              <div class="crayon-line" id="crayon-576865dd2ce6a035901578-37">
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                10
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-sy">
                ;
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
              </div>
             </div>
            </td>
           </tr>
          </tbody>
         </table>
        </div>
       </div>
       <!-- [Format Time: 0.0184 seconds] -->
       <p>
        还是几个步骤
        <br/>
        0.先看语句运行多长时间，10条记录用了13秒，已经不可忍受
       </p>
       <!-- Crayon Syntax Highlighter v_2.7.2_beta -->
       <div class="crayon-syntax crayon-theme-classic crayon-font-monaco crayon-os-pc print-yes notranslate" data-settings=" minimize scroll-mouseover" id="crayon-576865dd2ce71729074574" style=" margin-top: 12px; margin-bottom: 12px; font-size: 12px !important; line-height: 15px !important;">
        <div class="crayon-toolbar" data-settings=" mouseover overlay hide delay" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">
         <span class="crayon-title">
         </span>
         <div class="crayon-tools" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">
          <div class="crayon-button crayon-nums-button" title="切换是否显示行编号">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-plain-button" title="纯文本显示代码">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-wrap-button" title="切换自动换行">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-expand-button" title="点击展开代码">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-copy-button" title="复制代码">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-popup-button" title="在新窗口中显示代码">
           <div class="crayon-button-icon">
           </div>
          </div>
         </div>
        </div>
        <div class="crayon-info" style="min-height: 16.8px !important; line-height: 16.8px !important;">
        </div>
        <div class="crayon-plain-wrap">
         <textarea class="crayon-plain print-no" data-settings="dblclick" readonly="" style="-moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4; font-size: 12px !important; line-height: 15px !important;" wrap="soft">
          10 rows in &lt;span class="operator"&gt;&lt;span class="keyword"&gt;set&lt;/span&gt; (&lt;span class="number"&gt;13.06&lt;/span&gt; sec)&lt;/span&gt;
         </textarea>
        </div>
        <div class="crayon-main" style="">
         <table class="crayon-table">
          <tbody>
           <tr class="crayon-row">
            <td class="crayon-nums " data-settings="show">
             <div class="crayon-nums-content" style="font-size: 12px !important; line-height: 15px !important;">
              <div class="crayon-num" data-line="crayon-576865dd2ce71729074574-1">
               1
              </div>
             </div>
            </td>
            <td class="crayon-code">
             <div class="crayon-pre" style="font-size: 12px !important; line-height: 15px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;">
              <div class="crayon-line" id="crayon-576865dd2ce71729074574-1">
               <span class="crayon-cn">
                10
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-e">
                rows
               </span>
               <span class="crayon-st">
                in
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "operator"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                set
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-sy">
                (
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                13.06
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                sec
               </span>
               <span class="crayon-sy">
                )
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
              </div>
             </div>
            </td>
           </tr>
          </tbody>
         </table>
        </div>
       </div>
       <!-- [Format Time: 0.0020 seconds] -->
       <p>
        1.explain
       </p>
       <!-- Crayon Syntax Highlighter v_2.7.2_beta -->
       <div class="crayon-syntax crayon-theme-classic crayon-font-monaco crayon-os-pc print-yes notranslate" data-settings=" minimize scroll-mouseover" id="crayon-576865dd2ce77690382103" style=" margin-top: 12px; margin-bottom: 12px; font-size: 12px !important; line-height: 15px !important;">
        <div class="crayon-toolbar" data-settings=" mouseover overlay hide delay" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">
         <span class="crayon-title">
         </span>
         <div class="crayon-tools" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">
          <div class="crayon-button crayon-nums-button" title="切换是否显示行编号">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-plain-button" title="纯文本显示代码">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-wrap-button" title="切换自动换行">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-expand-button" title="点击展开代码">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-copy-button" title="复制代码">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-popup-button" title="在新窗口中显示代码">
           <div class="crayon-button-icon">
           </div>
          </div>
         </div>
        </div>
        <div class="crayon-info" style="min-height: 16.8px !important; line-height: 16.8px !important;">
        </div>
        <div class="crayon-plain-wrap">
         <textarea class="crayon-plain print-no" data-settings="dblclick" readonly="" style="-moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4; font-size: 12px !important; line-height: 15px !important;" wrap="soft">
          +&lt;span class="comment"&gt;----+-------------+-------+--------+-------------------------------------+-------------------------+---------+--------------------------+------+----------------------------------------------+&lt;/span&gt;
| id | select_type | table | type   | possible_keys                       | key                     | key_len | ref                      | rows | Extra                                        |
+&lt;span class="comment"&gt;----+-------------+-------+--------+-------------------------------------+-------------------------+---------+--------------------------+------+----------------------------------------------+&lt;/span&gt;
|  1 | SIMPLE      | oei   | ref    | idx_category_left_right,idx_data_id | idx_category_left_right | 5       | const                    | 8849 | Using where; Using temporary; Using filesort |
|  1 | SIMPLE      | bu    | ref    | PRIMARY,idx_userid_status           | idx_userid_status       | 4       | meituancrm.oei.data_id   |   76 | Using where; Using index                     |
|  1 | SIMPLE      | cb    | ref    | idx_branch_id,idx_contact_branch_id | idx_branch_id           | 4       | meituancrm.bu.branch_id  |    1 |                                              |
|  1 | SIMPLE      | c     | eq_ref | PRIMARY                             | PRIMARY                 | 108     | meituancrm.cb.contact_id |    1 |                                              |
+&lt;span class="comment"&gt;----+-------------+-------+--------+-------------------------------------+-------------------------+---------+--------------------------+------+----------------------------------------------+&lt;/span&gt;
         </textarea>
        </div>
        <div class="crayon-main" style="">
         <table class="crayon-table">
          <tbody>
           <tr class="crayon-row">
            <td class="crayon-nums " data-settings="show">
             <div class="crayon-nums-content" style="font-size: 12px !important; line-height: 15px !important;">
              <div class="crayon-num" data-line="crayon-576865dd2ce77690382103-1">
               1
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576865dd2ce77690382103-2">
               2
              </div>
              <div class="crayon-num" data-line="crayon-576865dd2ce77690382103-3">
               3
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576865dd2ce77690382103-4">
               4
              </div>
              <div class="crayon-num" data-line="crayon-576865dd2ce77690382103-5">
               5
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576865dd2ce77690382103-6">
               6
              </div>
              <div class="crayon-num" data-line="crayon-576865dd2ce77690382103-7">
               7
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576865dd2ce77690382103-8">
               8
              </div>
             </div>
            </td>
            <td class="crayon-code">
             <div class="crayon-pre" style="font-size: 12px !important; line-height: 15px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;">
              <div class="crayon-line" id="crayon-576865dd2ce77690382103-1">
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "comment"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576865dd2ce77690382103-2">
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                id
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                select_type
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                table
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                type
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                possible_keys
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                key
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                key_len
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                ref
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                rows
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                Extra
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
              </div>
              <div class="crayon-line" id="crayon-576865dd2ce77690382103-3">
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "comment"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576865dd2ce77690382103-4">
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-cn">
                1
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                SIMPLE
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                oei
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                ref
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                idx_category_left_right
               </span>
               <span class="crayon-sy">
                ,
               </span>
               <span class="crayon-v">
                idx_data_id
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                idx_category_left_right
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-cn">
                5
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-m">
                const
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-cn">
                8849
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-e">
                Using
               </span>
               <span class="crayon-v">
                where
               </span>
               <span class="crayon-sy">
                ;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-e">
                Using
               </span>
               <span class="crayon-v">
                temporary
               </span>
               <span class="crayon-sy">
                ;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-e">
                Using
               </span>
               <span class="crayon-v">
                filesort
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
              </div>
              <div class="crayon-line" id="crayon-576865dd2ce77690382103-5">
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-cn">
                1
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                SIMPLE
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                bu
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                ref
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                PRIMARY
               </span>
               <span class="crayon-sy">
                ,
               </span>
               <span class="crayon-v">
                idx_userid_status
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                idx_userid_status
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-cn">
                4
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                meituancrm
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                oei
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                data_id
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-cn">
                76
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-e">
                Using
               </span>
               <span class="crayon-v">
                where
               </span>
               <span class="crayon-sy">
                ;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-e">
                Using
               </span>
               <span class="crayon-v">
                index
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576865dd2ce77690382103-6">
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-cn">
                1
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                SIMPLE
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                cb
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                ref
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                idx_branch_id
               </span>
               <span class="crayon-sy">
                ,
               </span>
               <span class="crayon-v">
                idx_contact_branch_id
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                idx_branch_id
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-cn">
                4
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                meituancrm
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                bu
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                branch_id
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-cn">
                1
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
              </div>
              <div class="crayon-line" id="crayon-576865dd2ce77690382103-7">
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-cn">
                1
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                SIMPLE
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                c
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                eq_ref
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                PRIMARY
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                PRIMARY
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-cn">
                108
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                meituancrm
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                cb
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                contact_id
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-cn">
                1
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576865dd2ce77690382103-8">
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "comment"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
              </div>
             </div>
            </td>
           </tr>
          </tbody>
         </table>
        </div>
       </div>
       <!-- [Format Time: 0.0197 seconds] -->
       <p>
        从执行计划上看，mysql先查org_emp_info表扫描8849记录，再用索引idx_userid_status关联branch_user表，再用索引idx_branch_id关联contact_branch表，最后主键关联contact表。
        <br/>
        rows返回的都非常少，看不到有什么异常情况。我们在看一下语句，发现后面有order by + limit组合，会不会是排序量太大搞的？于是我们简化SQL，去掉后面的order by 和 limit，看看到底用了多少记录来排序
       </p>
       <!-- Crayon Syntax Highlighter v_2.7.2_beta -->
       <div class="crayon-syntax crayon-theme-classic crayon-font-monaco crayon-os-pc print-yes notranslate" data-settings=" minimize scroll-mouseover" id="crayon-576865dd2ce7f028713784" style=" margin-top: 12px; margin-bottom: 12px; font-size: 12px !important; line-height: 15px !important;">
        <div class="crayon-toolbar" data-settings=" mouseover overlay hide delay" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">
         <span class="crayon-title">
         </span>
         <div class="crayon-tools" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">
          <div class="crayon-button crayon-nums-button" title="切换是否显示行编号">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-plain-button" title="纯文本显示代码">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-wrap-button" title="切换自动换行">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-expand-button" title="点击展开代码">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-copy-button" title="复制代码">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-popup-button" title="在新窗口中显示代码">
           <div class="crayon-button-icon">
           </div>
          </div>
         </div>
        </div>
        <div class="crayon-info" style="min-height: 16.8px !important; line-height: 16.8px !important;">
        </div>
        <div class="crayon-plain-wrap">
         <textarea class="crayon-plain print-no" data-settings="dblclick" readonly="" style="-moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4; font-size: 12px !important; line-height: 15px !important;" wrap="soft">
          &lt;span class="operator"&gt;&lt;span class="keyword"&gt;select&lt;/span&gt;
  &lt;span class="aggregate"&gt;count&lt;/span&gt;(*)
&lt;span class="keyword"&gt;from&lt;/span&gt;
   contact c  
&lt;span class="keyword"&gt;inner&lt;/span&gt; &lt;span class="keyword"&gt;join&lt;/span&gt;
   contact_branch cb 
      &lt;span class="keyword"&gt;on&lt;/span&gt;  c.id = cb.contact_id  
&lt;span class="keyword"&gt;inner&lt;/span&gt; &lt;span class="keyword"&gt;join&lt;/span&gt;
   branch_user bu 
      &lt;span class="keyword"&gt;on&lt;/span&gt;  cb.branch_id = bu.branch_id 
      &lt;span class="keyword"&gt;and&lt;/span&gt; bu.status &lt;span class="keyword"&gt;in&lt;/span&gt; (
         &lt;span class="number"&gt;1&lt;/span&gt;,
      &lt;span class="number"&gt;2&lt;/span&gt;)  
   &lt;span class="keyword"&gt;inner&lt;/span&gt; &lt;span class="keyword"&gt;join&lt;/span&gt;
      org_emp_info oei 
         &lt;span class="keyword"&gt;on&lt;/span&gt;  oei.data_id = bu.user_id 
         &lt;span class="keyword"&gt;and&lt;/span&gt; oei.node_left &amp;gt;= &lt;span class="number"&gt;2875&lt;/span&gt; 
         &lt;span class="keyword"&gt;and&lt;/span&gt; oei.node_right &amp;lt;= &lt;span class="number"&gt;10802&lt;/span&gt; 
         &lt;span class="keyword"&gt;and&lt;/span&gt; oei.org_category = - &lt;span class="number"&gt;1&lt;/span&gt;  
+----------+
| &lt;span class="aggregate"&gt;count&lt;/span&gt;(*) |
+----------+
|   &lt;span class="number"&gt;778878&lt;/span&gt; |
+----------+
&lt;span class="number"&gt;1&lt;/span&gt; &lt;span class="keyword"&gt;row&lt;/span&gt; &lt;span class="keyword"&gt;in&lt;/span&gt; &lt;span class="keyword"&gt;set&lt;/span&gt; (&lt;span class="number"&gt;5.19&lt;/span&gt; sec)&lt;/span&gt;
         </textarea>
        </div>
        <div class="crayon-main" style="">
         <table class="crayon-table">
          <tbody>
           <tr class="crayon-row">
            <td class="crayon-nums " data-settings="show">
             <div class="crayon-nums-content" style="font-size: 12px !important; line-height: 15px !important;">
              <div class="crayon-num" data-line="crayon-576865dd2ce7f028713784-1">
               1
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576865dd2ce7f028713784-2">
               2
              </div>
              <div class="crayon-num" data-line="crayon-576865dd2ce7f028713784-3">
               3
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576865dd2ce7f028713784-4">
               4
              </div>
              <div class="crayon-num" data-line="crayon-576865dd2ce7f028713784-5">
               5
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576865dd2ce7f028713784-6">
               6
              </div>
              <div class="crayon-num" data-line="crayon-576865dd2ce7f028713784-7">
               7
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576865dd2ce7f028713784-8">
               8
              </div>
              <div class="crayon-num" data-line="crayon-576865dd2ce7f028713784-9">
               9
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576865dd2ce7f028713784-10">
               10
              </div>
              <div class="crayon-num" data-line="crayon-576865dd2ce7f028713784-11">
               11
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576865dd2ce7f028713784-12">
               12
              </div>
              <div class="crayon-num" data-line="crayon-576865dd2ce7f028713784-13">
               13
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576865dd2ce7f028713784-14">
               14
              </div>
              <div class="crayon-num" data-line="crayon-576865dd2ce7f028713784-15">
               15
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576865dd2ce7f028713784-16">
               16
              </div>
              <div class="crayon-num" data-line="crayon-576865dd2ce7f028713784-17">
               17
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576865dd2ce7f028713784-18">
               18
              </div>
              <div class="crayon-num" data-line="crayon-576865dd2ce7f028713784-19">
               19
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576865dd2ce7f028713784-20">
               20
              </div>
              <div class="crayon-num" data-line="crayon-576865dd2ce7f028713784-21">
               21
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576865dd2ce7f028713784-22">
               22
              </div>
              <div class="crayon-num" data-line="crayon-576865dd2ce7f028713784-23">
               23
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576865dd2ce7f028713784-24">
               24
              </div>
              <div class="crayon-num" data-line="crayon-576865dd2ce7f028713784-25">
               25
              </div>
             </div>
            </td>
            <td class="crayon-code">
             <div class="crayon-pre" style="font-size: 12px !important; line-height: 15px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;">
              <div class="crayon-line" id="crayon-576865dd2ce7f028713784-1">
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "operator"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                select
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576865dd2ce7f028713784-2">
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "aggregate"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                count
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-sy">
                (
               </span>
               <span class="crayon-o">
                *
               </span>
               <span class="crayon-sy">
                )
               </span>
              </div>
              <div class="crayon-line" id="crayon-576865dd2ce7f028713784-3">
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                from
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576865dd2ce7f028713784-4">
               <span class="crayon-h">
               </span>
               <span class="crayon-i">
                contact
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                c
               </span>
               <span class="crayon-h">
               </span>
              </div>
              <div class="crayon-line" id="crayon-576865dd2ce7f028713784-5">
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                inner
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                join
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576865dd2ce7f028713784-6">
               <span class="crayon-h">
               </span>
               <span class="crayon-e">
                contact_branch
               </span>
               <span class="crayon-v">
                cb
               </span>
               <span class="crayon-h">
               </span>
              </div>
              <div class="crayon-line" id="crayon-576865dd2ce7f028713784-7">
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                on
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                c
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                id
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                cb
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                contact_id
               </span>
               <span class="crayon-h">
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576865dd2ce7f028713784-8">
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                inner
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                join
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
              </div>
              <div class="crayon-line" id="crayon-576865dd2ce7f028713784-9">
               <span class="crayon-h">
               </span>
               <span class="crayon-e">
                branch_user
               </span>
               <span class="crayon-v">
                bu
               </span>
               <span class="crayon-h">
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576865dd2ce7f028713784-10">
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                on
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                cb
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                branch_id
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                bu
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                branch_id
               </span>
               <span class="crayon-h">
               </span>
              </div>
              <div class="crayon-line" id="crayon-576865dd2ce7f028713784-11">
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-st">
                and
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                bu
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                status
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-st">
                in
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-sy">
                (
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576865dd2ce7f028713784-12">
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                1
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-sy">
                ,
               </span>
              </div>
              <div class="crayon-line" id="crayon-576865dd2ce7f028713784-13">
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                2
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-sy">
                )
               </span>
               <span class="crayon-h">
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576865dd2ce7f028713784-14">
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                inner
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                join
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
              </div>
              <div class="crayon-line" id="crayon-576865dd2ce7f028713784-15">
               <span class="crayon-h">
               </span>
               <span class="crayon-e">
                org_emp_info
               </span>
               <span class="crayon-v">
                oei
               </span>
               <span class="crayon-h">
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576865dd2ce7f028713784-16">
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                on
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                oei
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                data_id
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                bu
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                user_id
               </span>
               <span class="crayon-h">
               </span>
              </div>
              <div class="crayon-line" id="crayon-576865dd2ce7f028713784-17">
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-st">
                and
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                oei
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                node_left
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &amp;
               </span>
               <span class="crayon-v">
                gt
               </span>
               <span class="crayon-sy">
                ;
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                2875
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576865dd2ce7f028713784-18">
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-st">
                and
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                oei
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                node_right
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &amp;
               </span>
               <span class="crayon-v">
                lt
               </span>
               <span class="crayon-sy">
                ;
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                10802
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
              </div>
              <div class="crayon-line" id="crayon-576865dd2ce7f028713784-19">
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-st">
                and
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                oei
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                org_category
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                1
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576865dd2ce7f028713784-20">
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                +
               </span>
              </div>
              <div class="crayon-line" id="crayon-576865dd2ce7f028713784-21">
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "aggregate"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                count
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-sy">
                (
               </span>
               <span class="crayon-o">
                *
               </span>
               <span class="crayon-sy">
                )
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576865dd2ce7f028713784-22">
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                +
               </span>
              </div>
              <div class="crayon-line" id="crayon-576865dd2ce7f028713784-23">
               <span class="crayon-o">
                |
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                778878
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                |
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576865dd2ce7f028713784-24">
               <span class="crayon-o">
                +
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                --
               </span>
               <span class="crayon-o">
                +
               </span>
              </div>
              <div class="crayon-line" id="crayon-576865dd2ce7f028713784-25">
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                1
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                row
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-st">
                in
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                set
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-sy">
                (
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                5.19
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                sec
               </span>
               <span class="crayon-sy">
                )
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
              </div>
             </div>
            </td>
           </tr>
          </tbody>
         </table>
        </div>
       </div>
       <!-- [Format Time: 0.0166 seconds] -->
       <p>
        发现排序之前居然锁定了778878条记录，如果针对70万的结果集排序，将是灾难性的，怪不得这么慢，那我们能不能换个思路，先根据contact的created_time排序，再来join会不会比较快呢？
        <br/>
        于是改造成下面的语句，也可以用straight_join来优化
        <br/>
        select
        <br/>
        c.id,
        <br/>
        c.name,
        <br/>
        c.position,
        <br/>
        c.sex,
        <br/>
        c.phone,
        <br/>
        c.office_phone,
        <br/>
        c.feature_info,
        <br/>
        c.birthday,
        <br/>
        c.creator_id,
        <br/>
        c.is_keyperson,
        <br/>
        c.giveup_reason,
        <br/>
        c.status,
        <br/>
        c.data_source,
        <br/>
        from_unixtime(c.created_time) as created_time,
        <br/>
        from_unixtime(c.last_modified) as last_modified,
        <br/>
        c.last_modified_user_id
        <br/>
        from
        <br/>
        contact c
        <br/>
        where
        <br/>
        exists (
        <br/>
        select
        <br/>
        1
        <br/>
        from
        <br/>
        contact_branch cb
        <br/>
        inner join
        <br/>
        branch_user bu
        <br/>
        on cb.branch_id = bu.branch_id
        <br/>
        and bu.status in (
        <br/>
        1,
        <br/>
        2)
        <br/>
        inner join
        <br/>
        org_emp_info oei
        <br/>
        on oei.data_id = bu.user_id
        <br/>
        and oei.node_left &gt;= 2875
        <br/>
        and oei.node_right &lt;= 10802
        <br/>
        and oei.org_category = – 1
        <br/>
        where
        <br/>
        c.id = cb.contact_id
        <br/>
        )
        <br/>
        order by
        <br/>
        c.created_time desc limit 0 ,
        <br/>
        10;
       </p>
       <!-- Crayon Syntax Highlighter v_2.7.2_beta -->
       <div class="crayon-syntax crayon-theme-classic crayon-font-monaco crayon-os-pc print-yes notranslate" data-settings=" minimize scroll-mouseover" id="crayon-576865dd2ce87442046979" style=" margin-top: 12px; margin-bottom: 12px; font-size: 12px !important; line-height: 15px !important;">
        <div class="crayon-toolbar" data-settings=" mouseover overlay hide delay" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">
         <span class="crayon-title">
         </span>
         <div class="crayon-tools" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">
          <div class="crayon-button crayon-nums-button" title="切换是否显示行编号">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-plain-button" title="纯文本显示代码">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-wrap-button" title="切换自动换行">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-expand-button" title="点击展开代码">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-copy-button" title="复制代码">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-popup-button" title="在新窗口中显示代码">
           <div class="crayon-button-icon">
           </div>
          </div>
         </div>
        </div>
        <div class="crayon-info" style="min-height: 16.8px !important; line-height: 16.8px !important;">
        </div>
        <div class="crayon-plain-wrap">
         <textarea class="crayon-plain print-no" data-settings="dblclick" readonly="" style="-moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4; font-size: 12px !important; line-height: 15px !important;" wrap="soft">
          验证一下效果 预计在1ms内，提升了13000多倍！
```sql
10 rows in set (0.00 sec)
         </textarea>
        </div>
        <div class="crayon-main" style="">
         <table class="crayon-table">
          <tbody>
           <tr class="crayon-row">
            <td class="crayon-nums " data-settings="show">
             <div class="crayon-nums-content" style="font-size: 12px !important; line-height: 15px !important;">
              <div class="crayon-num" data-line="crayon-576865dd2ce87442046979-1">
               1
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576865dd2ce87442046979-2">
               2
              </div>
              <div class="crayon-num" data-line="crayon-576865dd2ce87442046979-3">
               3
              </div>
             </div>
            </td>
            <td class="crayon-code">
             <div class="crayon-pre" style="font-size: 12px !important; line-height: 15px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;">
              <div class="crayon-line" id="crayon-576865dd2ce87442046979-1">
               验证一下效果
               <span class="crayon-h">
               </span>
               预计在
               <span class="crayon-cn">
                1ms
               </span>
               内，提升了
               <span class="crayon-cn">
                13000
               </span>
               多倍！
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576865dd2ce87442046979-2">
               <span class="crayon-sy">
                `
               </span>
               <span class="crayon-sy">
                `
               </span>
               <span class="crayon-sy">
                `
               </span>
               <span class="crayon-i">
                sql
               </span>
              </div>
              <div class="crayon-line" id="crayon-576865dd2ce87442046979-3">
               <span class="crayon-cn">
                10
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-e">
                rows
               </span>
               <span class="crayon-st">
                in
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-e">
                set
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-sy">
                (
               </span>
               <span class="crayon-cn">
                0.00
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                sec
               </span>
               <span class="crayon-sy">
                )
               </span>
              </div>
             </div>
            </td>
           </tr>
          </tbody>
         </table>
        </div>
       </div>
       <!-- [Format Time: 0.0014 seconds] -->
       <p>
        本以为至此大工告成，但我们在前面的分析中漏了一个细节，先排序再join和先join再排序理论上开销是一样的，为何提升这么多是因为有一个limit！大致执行过程是：mysql先按索引排序得到前10条记录，然后再去join过滤，当发现不够10条的时候，再次去10条，再次join，这显然在内层join过滤的数据非常多的时候，将是灾难的，极端情况，内层一条数据都找不到，mysql还傻乎乎的每次取10条，几乎遍历了这个数据表！
        <br/>
        用不同参数的SQL试验下
       </p>
       <!-- Crayon Syntax Highlighter v_2.7.2_beta -->
       <div class="crayon-syntax crayon-theme-classic crayon-font-monaco crayon-os-pc print-yes notranslate" data-settings=" minimize scroll-mouseover" id="crayon-576865dd2ce8d253134327" style=" margin-top: 12px; margin-bottom: 12px; font-size: 12px !important; line-height: 15px !important;">
        <div class="crayon-toolbar" data-settings=" mouseover overlay hide delay" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">
         <span class="crayon-title">
         </span>
         <div class="crayon-tools" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">
          <div class="crayon-button crayon-nums-button" title="切换是否显示行编号">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-plain-button" title="纯文本显示代码">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-wrap-button" title="切换自动换行">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-expand-button" title="点击展开代码">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-copy-button" title="复制代码">
           <div class="crayon-button-icon">
           </div>
          </div>
          <div class="crayon-button crayon-popup-button" title="在新窗口中显示代码">
           <div class="crayon-button-icon">
           </div>
          </div>
         </div>
        </div>
        <div class="crayon-info" style="min-height: 16.8px !important; line-height: 16.8px !important;">
        </div>
        <div class="crayon-plain-wrap">
         <textarea class="crayon-plain print-no" data-settings="dblclick" readonly="" style="-moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4; font-size: 12px !important; line-height: 15px !important;" wrap="soft">
          &lt;span class="operator"&gt;&lt;span class="keyword"&gt;select&lt;/span&gt;
   sql_no_cache   c.id,
   c.name,
   c.position,
   c.sex,
   c.phone,
   c.office_phone,
   c.feature_info,
   c.birthday,
   c.creator_id,
   c.is_keyperson,
   c.giveup_reason,
   c.status,
   c.data_source,
   from_unixtime(c.created_time) &lt;span class="keyword"&gt;as&lt;/span&gt; created_time,
   from_unixtime(c.last_modified) &lt;span class="keyword"&gt;as&lt;/span&gt; last_modified,
   c.last_modified_user_id    
&lt;span class="keyword"&gt;from&lt;/span&gt;
   contact c   
&lt;span class="keyword"&gt;where&lt;/span&gt;
   &lt;span class="keyword"&gt;exists&lt;/span&gt; (
      &lt;span class="keyword"&gt;select&lt;/span&gt;
         &lt;span class="number"&gt;1&lt;/span&gt;        
      &lt;span class="keyword"&gt;from&lt;/span&gt;
         contact_branch cb         
      &lt;span class="keyword"&gt;inner&lt;/span&gt; &lt;span class="keyword"&gt;join&lt;/span&gt;
         branch_user bu                     
            &lt;span class="keyword"&gt;on&lt;/span&gt;  cb.branch_id = bu.branch_id                     
            &lt;span class="keyword"&gt;and&lt;/span&gt; bu.status &lt;span class="keyword"&gt;in&lt;/span&gt; (
               &lt;span class="number"&gt;1&lt;/span&gt;,
            &lt;span class="number"&gt;2&lt;/span&gt;)                
         &lt;span class="keyword"&gt;inner&lt;/span&gt; &lt;span class="keyword"&gt;join&lt;/span&gt;
            org_emp_info oei                           
               &lt;span class="keyword"&gt;on&lt;/span&gt;  oei.data_id = bu.user_id                           
               &lt;span class="keyword"&gt;and&lt;/span&gt; oei.node_left &amp;gt;= &lt;span class="number"&gt;2875&lt;/span&gt;                           
               &lt;span class="keyword"&gt;and&lt;/span&gt; oei.node_right &amp;lt;= &lt;span class="number"&gt;2875&lt;/span&gt;                           
               &lt;span class="keyword"&gt;and&lt;/span&gt; oei.org_category = - &lt;span class="number"&gt;1&lt;/span&gt;                
         &lt;span class="keyword"&gt;where&lt;/span&gt;
            c.id = cb.contact_id           
      )        
   &lt;span class="keyword"&gt;order&lt;/span&gt; &lt;span class="keyword"&gt;by&lt;/span&gt;
      c.created_time &lt;span class="keyword"&gt;desc&lt;/span&gt;  limit &lt;span class="number"&gt;0&lt;/span&gt; ,
      &lt;span class="number"&gt;10&lt;/span&gt;;&lt;/span&gt;
Empty &lt;span class="operator"&gt;&lt;span class="keyword"&gt;set&lt;/span&gt; (&lt;span class="number"&gt;2&lt;/span&gt; &lt;span class="aggregate"&gt;min&lt;/span&gt; &lt;span class="number"&gt;18.99&lt;/span&gt; sec)&lt;/span&gt;
         </textarea>
        </div>
        <div class="crayon-main" style="">
         <table class="crayon-table">
          <tbody>
           <tr class="crayon-row">
            <td class="crayon-nums " data-settings="show">
             <div class="crayon-nums-content" style="font-size: 12px !important; line-height: 15px !important;">
              <div class="crayon-num" data-line="crayon-576865dd2ce8d253134327-1">
               1
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576865dd2ce8d253134327-2">
               2
              </div>
              <div class="crayon-num" data-line="crayon-576865dd2ce8d253134327-3">
               3
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576865dd2ce8d253134327-4">
               4
              </div>
              <div class="crayon-num" data-line="crayon-576865dd2ce8d253134327-5">
               5
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576865dd2ce8d253134327-6">
               6
              </div>
              <div class="crayon-num" data-line="crayon-576865dd2ce8d253134327-7">
               7
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576865dd2ce8d253134327-8">
               8
              </div>
              <div class="crayon-num" data-line="crayon-576865dd2ce8d253134327-9">
               9
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576865dd2ce8d253134327-10">
               10
              </div>
              <div class="crayon-num" data-line="crayon-576865dd2ce8d253134327-11">
               11
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576865dd2ce8d253134327-12">
               12
              </div>
              <div class="crayon-num" data-line="crayon-576865dd2ce8d253134327-13">
               13
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576865dd2ce8d253134327-14">
               14
              </div>
              <div class="crayon-num" data-line="crayon-576865dd2ce8d253134327-15">
               15
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576865dd2ce8d253134327-16">
               16
              </div>
              <div class="crayon-num" data-line="crayon-576865dd2ce8d253134327-17">
               17
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576865dd2ce8d253134327-18">
               18
              </div>
              <div class="crayon-num" data-line="crayon-576865dd2ce8d253134327-19">
               19
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576865dd2ce8d253134327-20">
               20
              </div>
              <div class="crayon-num" data-line="crayon-576865dd2ce8d253134327-21">
               21
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576865dd2ce8d253134327-22">
               22
              </div>
              <div class="crayon-num" data-line="crayon-576865dd2ce8d253134327-23">
               23
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576865dd2ce8d253134327-24">
               24
              </div>
              <div class="crayon-num" data-line="crayon-576865dd2ce8d253134327-25">
               25
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576865dd2ce8d253134327-26">
               26
              </div>
              <div class="crayon-num" data-line="crayon-576865dd2ce8d253134327-27">
               27
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576865dd2ce8d253134327-28">
               28
              </div>
              <div class="crayon-num" data-line="crayon-576865dd2ce8d253134327-29">
               29
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576865dd2ce8d253134327-30">
               30
              </div>
              <div class="crayon-num" data-line="crayon-576865dd2ce8d253134327-31">
               31
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576865dd2ce8d253134327-32">
               32
              </div>
              <div class="crayon-num" data-line="crayon-576865dd2ce8d253134327-33">
               33
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576865dd2ce8d253134327-34">
               34
              </div>
              <div class="crayon-num" data-line="crayon-576865dd2ce8d253134327-35">
               35
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576865dd2ce8d253134327-36">
               36
              </div>
              <div class="crayon-num" data-line="crayon-576865dd2ce8d253134327-37">
               37
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576865dd2ce8d253134327-38">
               38
              </div>
              <div class="crayon-num" data-line="crayon-576865dd2ce8d253134327-39">
               39
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576865dd2ce8d253134327-40">
               40
              </div>
              <div class="crayon-num" data-line="crayon-576865dd2ce8d253134327-41">
               41
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576865dd2ce8d253134327-42">
               42
              </div>
              <div class="crayon-num" data-line="crayon-576865dd2ce8d253134327-43">
               43
              </div>
              <div class="crayon-num crayon-striped-num" data-line="crayon-576865dd2ce8d253134327-44">
               44
              </div>
             </div>
            </td>
            <td class="crayon-code">
             <div class="crayon-pre" style="font-size: 12px !important; line-height: 15px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;">
              <div class="crayon-line" id="crayon-576865dd2ce8d253134327-1">
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "operator"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                select
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576865dd2ce8d253134327-2">
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                sql_no
               </span>
               <span class="crayon-sy">
                _
               </span>
               cache
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                c
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                id
               </span>
               <span class="crayon-sy">
                ,
               </span>
              </div>
              <div class="crayon-line" id="crayon-576865dd2ce8d253134327-3">
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                c
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                name
               </span>
               <span class="crayon-sy">
                ,
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576865dd2ce8d253134327-4">
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                c
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                position
               </span>
               <span class="crayon-sy">
                ,
               </span>
              </div>
              <div class="crayon-line" id="crayon-576865dd2ce8d253134327-5">
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                c
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                sex
               </span>
               <span class="crayon-sy">
                ,
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576865dd2ce8d253134327-6">
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                c
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                phone
               </span>
               <span class="crayon-sy">
                ,
               </span>
              </div>
              <div class="crayon-line" id="crayon-576865dd2ce8d253134327-7">
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                c
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                office_phone
               </span>
               <span class="crayon-sy">
                ,
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576865dd2ce8d253134327-8">
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                c
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                feature_info
               </span>
               <span class="crayon-sy">
                ,
               </span>
              </div>
              <div class="crayon-line" id="crayon-576865dd2ce8d253134327-9">
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                c
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                birthday
               </span>
               <span class="crayon-sy">
                ,
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576865dd2ce8d253134327-10">
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                c
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                creator_id
               </span>
               <span class="crayon-sy">
                ,
               </span>
              </div>
              <div class="crayon-line" id="crayon-576865dd2ce8d253134327-11">
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                c
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                is_keyperson
               </span>
               <span class="crayon-sy">
                ,
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576865dd2ce8d253134327-12">
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                c
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                giveup_reason
               </span>
               <span class="crayon-sy">
                ,
               </span>
              </div>
              <div class="crayon-line" id="crayon-576865dd2ce8d253134327-13">
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                c
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                status
               </span>
               <span class="crayon-sy">
                ,
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576865dd2ce8d253134327-14">
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                c
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                data_source
               </span>
               <span class="crayon-sy">
                ,
               </span>
              </div>
              <div class="crayon-line" id="crayon-576865dd2ce8d253134327-15">
               <span class="crayon-h">
               </span>
               <span class="crayon-e">
                from_unixtime
               </span>
               <span class="crayon-sy">
                (
               </span>
               <span class="crayon-v">
                c
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                created_time
               </span>
               <span class="crayon-sy">
                )
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-st">
                as
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                created_time
               </span>
               <span class="crayon-sy">
                ,
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576865dd2ce8d253134327-16">
               <span class="crayon-h">
               </span>
               <span class="crayon-e">
                from_unixtime
               </span>
               <span class="crayon-sy">
                (
               </span>
               <span class="crayon-v">
                c
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                last_modified
               </span>
               <span class="crayon-sy">
                )
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-st">
                as
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                last_modified
               </span>
               <span class="crayon-sy">
                ,
               </span>
              </div>
              <div class="crayon-line" id="crayon-576865dd2ce8d253134327-17">
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                c
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                last_modified_user_id
               </span>
               <span class="crayon-h">
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576865dd2ce8d253134327-18">
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                from
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
              </div>
              <div class="crayon-line" id="crayon-576865dd2ce8d253134327-19">
               <span class="crayon-h">
               </span>
               <span class="crayon-i">
                contact
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                c
               </span>
               <span class="crayon-h">
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576865dd2ce8d253134327-20">
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                where
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
              </div>
              <div class="crayon-line" id="crayon-576865dd2ce8d253134327-21">
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                exists
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-sy">
                (
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576865dd2ce8d253134327-22">
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                select
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
              </div>
              <div class="crayon-line" id="crayon-576865dd2ce8d253134327-23">
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                1
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576865dd2ce8d253134327-24">
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                from
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
              </div>
              <div class="crayon-line" id="crayon-576865dd2ce8d253134327-25">
               <span class="crayon-h">
               </span>
               <span class="crayon-e">
                contact_branch
               </span>
               <span class="crayon-v">
                cb
               </span>
               <span class="crayon-h">
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576865dd2ce8d253134327-26">
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                inner
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                join
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
              </div>
              <div class="crayon-line" id="crayon-576865dd2ce8d253134327-27">
               <span class="crayon-h">
               </span>
               <span class="crayon-e">
                branch_user
               </span>
               <span class="crayon-v">
                bu
               </span>
               <span class="crayon-h">
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576865dd2ce8d253134327-28">
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                on
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                cb
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                branch_id
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                bu
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                branch_id
               </span>
               <span class="crayon-h">
               </span>
              </div>
              <div class="crayon-line" id="crayon-576865dd2ce8d253134327-29">
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-st">
                and
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                bu
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                status
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-st">
                in
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-sy">
                (
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576865dd2ce8d253134327-30">
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                1
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-sy">
                ,
               </span>
              </div>
              <div class="crayon-line" id="crayon-576865dd2ce8d253134327-31">
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                2
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-sy">
                )
               </span>
               <span class="crayon-h">
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576865dd2ce8d253134327-32">
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                inner
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                join
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
              </div>
              <div class="crayon-line" id="crayon-576865dd2ce8d253134327-33">
               <span class="crayon-h">
               </span>
               <span class="crayon-e">
                org_emp_info
               </span>
               <span class="crayon-v">
                oei
               </span>
               <span class="crayon-h">
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576865dd2ce8d253134327-34">
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                on
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                oei
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                data_id
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                bu
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                user_id
               </span>
               <span class="crayon-h">
               </span>
              </div>
              <div class="crayon-line" id="crayon-576865dd2ce8d253134327-35">
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-st">
                and
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                oei
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                node_left
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &amp;
               </span>
               <span class="crayon-v">
                gt
               </span>
               <span class="crayon-sy">
                ;
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                2875
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576865dd2ce8d253134327-36">
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-st">
                and
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                oei
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                node_right
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &amp;
               </span>
               <span class="crayon-v">
                lt
               </span>
               <span class="crayon-sy">
                ;
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                2875
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
              </div>
              <div class="crayon-line" id="crayon-576865dd2ce8d253134327-37">
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-st">
                and
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                oei
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                org_category
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                -
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                1
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576865dd2ce8d253134327-38">
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                where
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
              </div>
              <div class="crayon-line" id="crayon-576865dd2ce8d253134327-39">
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                c
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                id
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                cb
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                contact
               </span>
               <span class="crayon-sy">
                _
               </span>
               id
               <span class="crayon-h">
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576865dd2ce8d253134327-40">
               <span class="crayon-h">
               </span>
               <span class="crayon-sy">
                )
               </span>
               <span class="crayon-h">
               </span>
              </div>
              <div class="crayon-line" id="crayon-576865dd2ce8d253134327-41">
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                order
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                by
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576865dd2ce8d253134327-42">
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                c
               </span>
               <span class="crayon-sy">
                .
               </span>
               <span class="crayon-v">
                created_time
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                desc
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                limit
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                0
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-sy">
                ,
               </span>
              </div>
              <div class="crayon-line" id="crayon-576865dd2ce8d253134327-43">
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                10
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-sy">
                ;
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
              </div>
              <div class="crayon-line crayon-striped-line" id="crayon-576865dd2ce8d253134327-44">
               <span class="crayon-v">
                Empty
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "operator"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "keyword"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                set
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-sy">
                (
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                2
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "aggregate"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-v">
                min
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-e">
                span
               </span>
               <span class="crayon-t">
                class
               </span>
               <span class="crayon-o">
                =
               </span>
               <span class="crayon-s">
                "number"
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-cn">
                18.99
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
               <span class="crayon-h">
               </span>
               <span class="crayon-v">
                sec
               </span>
               <span class="crayon-sy">
                )
               </span>
               <span class="crayon-o">
                &lt;
               </span>
               <span class="crayon-o">
                /
               </span>
               <span class="crayon-v">
                span
               </span>
               <span class="crayon-o">
                &gt;
               </span>
              </div>
             </div>
            </td>
           </tr>
          </tbody>
         </table>
        </div>
       </div>
       <!-- [Format Time: 0.0232 seconds] -->
       <p>
        2 min 18.99 sec！比之前的情况还糟糕很多。由于mysql的nested loop机制，遇到这种情况，基本是无法优化的。这条语句最终也只能交给应用系统去优化自己的逻辑了。
        <br/>
        通过这个例子我们可以看到，并不是所有语句都能优化，而往往我们优化时，由于SQL用例回归时落掉一些极端情况，会造成比原来还严重的后果。所以，第一：不要指望所有语句都能通过SQL优化，第二：不要过于自信，只针对具体case来优化，而忽略了更复杂的情况。
       </p>
       <p>
        慢查询的案例就分析到这儿，以上只是一些比较典型的案例。我们在优化过程中遇到过超过1000行，涉及到16个表join的“垃圾SQL”，也遇到过线上线下数据库差异导致应用直接被慢查询拖死，也遇到过varchar等值比较没有写单引号，还遇到过笛卡尔积查询直接把从库搞死。再多的案例其实也只是一些经验的积累，如果我们熟悉查询优化器、索引的内部原理，那么分析这些案例就变得特别简单了。
       </p>
       <h1 id="-">
        写在后面的话
       </h1>
       <p>
        本文以一个慢查询案例引入了MySQL索引原理、优化慢查询的一些方法论;并针对遇到的典型案例做了详细的分析。其实做了这么长时间的语句优化后才发现，任何数据库层面的优化都抵不上应用系统的优化，同样是MySQL，可以用来支撑Google/FaceBook/Taobao应用，但可能连你的个人网站都撑不住。套用最近比较流行的话：“查询容易，优化不易，且写且珍惜！”
       </p>
       <h1 id="-">
        参考
       </h1>
       <p>
        参考文献如下：
        <br/>
        1.《高性能MySQL》
        <br/>
        2.《数据结构与算法分析》
       </p>
       <p>
       </p>
       <blockquote>
        <p>
         作者：NeverMore
        </p>
        <p>
         文章出处：http://tech.meituan.com/mysql-index.html
        </p>
       </blockquote>
      </div>
      <div>
       <strong>
        注：转载文章均来自于公开网络，仅供学习使用，不会用于任何商业用途，如果侵犯到原作者的权益，请您与我们联系删除或者授权事宜，联系邮箱：contact@dataunion.org。转载数盟网站文章请注明原文章作者，否则产生的任何版权纠纷与数盟无关。
       </strong>
      </div>
      <!--content_text-->
      <div class="fenxian">
       <!-- JiaThis Button BEGIN -->
       <div class="jiathis_style_32x32">
        <p class="jiathis_button_weixin">
        </p>
        <p class="jiathis_button_tsina">
        </p>
        <p class="jiathis_button_qzone">
        </p>
        <p class="jiathis_button_cqq">
        </p>
        <p class="jiathis_button_tumblr">
        </p>
        <a class="jiathis jiathis_txt jtico jtico_jiathis" href="http://www.jiathis.com/share" target="_blank">
        </a>
        <p class="jiathis_counter_style">
        </p>
       </div>
       <!-- JiaThis Button END -->
      </div>
     </article>
     <!--content-->
     <!--相关文章-->
     <div class="xianguan">
      <div class="xianguantitle">
       相关文章！
      </div>
      <ul class="pic">
       <li>
        <a href="http://dataunion.org/20517.html">
         <img src="http://dataunion.org/wp-content/uploads/2015/07/t012366e61c52d9046b-300x228.png"/>
        </a>
        <a class="link" href="http://dataunion.org/20517.html" rel="bookmark" title="MySQL索引背后的数据结构及算法原理">
         MySQL索引背后的数据结构及算法原理
        </a>
       </li>
       <li>
        <a href="http://dataunion.org/20229.html">
         <img src="http://dataunion.org/wp-content/uploads/2015/07/t012366e61c52d9046b-300x228.png"/>
        </a>
        <a class="link" href="http://dataunion.org/20229.html" rel="bookmark" title="8 个不得不说的 MySQL 陷阱">
         8 个不得不说的 MySQL 陷阱
        </a>
       </li>
       <li>
        <a href="http://dataunion.org/20094.html">
         <img src="http://dataunion.org/wp-content/uploads/2015/07/t012366e61c52d9046b-300x228.png"/>
        </a>
        <a class="link" href="http://dataunion.org/20094.html" rel="bookmark" title="老叶观点：MySQL开发规范之我见">
         老叶观点：MySQL开发规范之我见
        </a>
       </li>
       <li>
        <a href="http://dataunion.org/19973.html">
         <img src="http://dataunion.org/wp-content/uploads/2015/06/u1068384158883784220fm21gp0.jpg"/>
        </a>
        <a class="link" href="http://dataunion.org/19973.html" rel="bookmark" title="MySQL 调优/优化的 100 个建议">
         MySQL 调优/优化的 100 个建议
        </a>
       </li>
      </ul>
     </div>
     <!--相关文章-->
     <div class="comment" id="comments">
      <!-- You can start editing here. -->
      <!-- If comments are open, but there are no comments. -->
      <div class="title">
       期待你一针见血的评论，Come on！
      </div>
      <div id="respond">
       <p>
        不用想啦，马上
        <a href="http://dataunion.org/wp-login.php?redirect_to=http%3A%2F%2Fdataunion.org%2F16514.html">
         "登录"
        </a>
        发表自已的想法.
       </p>
      </div>
     </div>
     <!-- .nav-single -->
    </div>
    <!--Container End-->
    <aside id="sitebar">
     <div class="sitebar_list2">
      <div class="wptag">
       <span class="tagtitle">
        热门标签+
       </span>
       <div class="tagg">
        <ul class="menu" id="menu-%e5%8f%8b%e6%83%85%e9%93%be%e6%8e%a5">
         <li class="menu-item menu-item-type-custom menu-item-object-custom menu-item-1605" id="menu-item-1605">
          <a href="http://taidizh.com/">
           泰迪智慧
          </a>
         </li>
         <li class="menu-item menu-item-type-custom menu-item-object-custom menu-item-20884" id="menu-item-20884">
          <a href="http://www.transwarp.cn/">
           星环科技
          </a>
         </li>
         <li class="menu-item menu-item-type-custom menu-item-object-custom menu-item-3538" id="menu-item-3538">
          <a href="http://datall.org/">
           珈和遥感
          </a>
         </li>
         <li class="menu-item menu-item-type-custom menu-item-object-custom menu-item-20888" id="menu-item-20888">
          <a href="http://www.chinahadoop.cn/">
           小象学院
          </a>
         </li>
        </ul>
       </div>
      </div>
     </div>
     <div class="sitebar_list">
      <div class="textwidget">
       <div align="center">
        <a href="http://study.163.com/course/courseMain.htm?courseId=991022" target="_blank">
         <img src="http://dataunion.org/wp-content/uploads/2016/03/dv.jpg"/>
        </a>
       </div>
      </div>
     </div>
     <div class="sitebar_list">
      <h4 class="sitebar_title">
       文章分类
      </h4>
      <div class="tagcloud">
       <a class="tag-link-44" href="http://dataunion.org/category/industry/demo" style="font-size: 10.204724409449pt;" title="4个话题">
        Demo展示
       </a>
       <a class="tag-link-31" href="http://dataunion.org/category/experts" style="font-size: 15.826771653543pt;" title="52个话题">
        专家团队
       </a>
       <a class="tag-link-870" href="http://dataunion.org/category/tech/ai" style="font-size: 19.795275590551pt;" title="273个话题">
        人工智能
       </a>
       <a class="tag-link-488" href="http://dataunion.org/category/%e5%8a%a0%e5%85%a5%e6%95%b0%e7%9b%9f" style="font-size: 8pt;" title="1个话题">
        加入数盟
       </a>
       <a class="tag-link-869" href="http://dataunion.org/category/tech/viz" style="font-size: 17.204724409449pt;" title="93个话题">
        可视化
       </a>
       <a class="tag-link-30" href="http://dataunion.org/category/partners" style="font-size: 10.645669291339pt;" title="5个话题">
        合作伙伴
       </a>
       <a class="tag-link-889" href="http://dataunion.org/category/parterc" style="font-size: 11.582677165354pt;" title="8个话题">
        合作会议
       </a>
       <a class="tag-link-104" href="http://dataunion.org/category/books" style="font-size: 12.96062992126pt;" title="15个话题">
        图书
       </a>
       <a class="tag-link-220" href="http://dataunion.org/category/tech/base" style="font-size: 19.850393700787pt;" title="281个话题">
        基础架构
       </a>
       <a class="tag-link-219" href="http://dataunion.org/category/tech/analysis" style="font-size: 19.409448818898pt;" title="232个话题">
        数据分析
       </a>
       <a class="tag-link-887" href="http://dataunion.org/category/tech/dm" style="font-size: 13.291338582677pt;" title="17个话题">
        数据挖掘
       </a>
       <a class="tag-link-34" href="http://dataunion.org/category/tech" style="font-size: 20.732283464567pt;" title="404个话题">
        文章
       </a>
       <a class="tag-link-1" href="http://dataunion.org/category/uncategorized" style="font-size: 22pt;" title="693个话题">
        未分类
       </a>
       <a class="tag-link-4" href="http://dataunion.org/category/events" style="font-size: 14.503937007874pt;" title="29个话题">
        活动
       </a>
       <a class="tag-link-890" href="http://dataunion.org/category/tech/%e6%b7%b1%e5%ba%a6%e5%ad%a6%e4%b9%a0" style="font-size: 10.204724409449pt;" title="4个话题">
        深度学习
       </a>
       <a class="tag-link-221" href="http://dataunion.org/category/tech/devl" style="font-size: 18.968503937008pt;" title="193个话题">
        编程语言
       </a>
       <a class="tag-link-888" href="http://dataunion.org/category/career" style="font-size: 15.661417322835pt;" title="48个话题">
        职业规划
       </a>
       <a class="tag-link-5" href="http://dataunion.org/category/jobs" style="font-size: 14.11811023622pt;" title="25个话题">
        职位
       </a>
       <a class="tag-link-871" href="http://dataunion.org/category/industry" style="font-size: 15.716535433071pt;" title="49个话题">
        行业
       </a>
       <a class="tag-link-613" href="http://dataunion.org/category/industry/case" style="font-size: 16.984251968504pt;" title="84个话题">
        行业应用
       </a>
       <a class="tag-link-885" href="http://dataunion.org/category/industry/news" style="font-size: 17.425196850394pt;" title="102个话题">
        行业资讯
       </a>
       <a class="tag-link-10" href="http://dataunion.org/category/training" style="font-size: 14.228346456693pt;" title="26个话题">
        课程
       </a>
       <a class="tag-link-16" href="http://dataunion.org/category/sources" style="font-size: 15.661417322835pt;" title="48个话题">
        资源
       </a>
      </div>
     </div>
     <div class="sitebar_list">
      <h4 class="sitebar_title">
       功能
      </h4>
      <ul>
       <li>
        <a href="http://dataunion.org/wp-login.php?action=register">
         注册
        </a>
       </li>
       <li>
        <a href="http://dataunion.org/wp-login.php">
         登录
        </a>
       </li>
       <li>
        <a href="http://dataunion.org/feed">
         文章
         <abbr title="Really Simple Syndication">
          RSS
         </abbr>
        </a>
       </li>
       <li>
        <a href="http://dataunion.org/comments/feed">
         评论
         <abbr title="Really Simple Syndication">
          RSS
         </abbr>
        </a>
       </li>
       <li>
        <a href="https://cn.wordpress.org/" title="基于WordPress，一个优美、先进的个人信息发布平台。">
         WordPress.org
        </a>
       </li>
      </ul>
     </div>
    </aside>
    <div class="clear">
    </div>
   </div>
   <!--main-->
   ﻿
   <footer id="dibu">
    <div class="about">
     <div class="right">
      <ul class="menu" id="menu-%e5%ba%95%e9%83%a8%e8%8f%9c%e5%8d%95">
       <li class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-18024" id="menu-item-18024">
        <a href="http://dataunion.org/category/partners">
         合作伙伴
        </a>
       </li>
       <li class="menu-item menu-item-type-post_type menu-item-object-page menu-item-20881" id="menu-item-20881">
        <a href="http://dataunion.org/contribute">
         文章投稿
        </a>
       </li>
       <li class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-20872" id="menu-item-20872">
        <a href="http://dataunion.org/category/%e5%8a%a0%e5%85%a5%e6%95%b0%e7%9b%9f">
         加入数盟
        </a>
       </li>
       <li class="menu-item menu-item-type-post_type menu-item-object-page menu-item-22441" id="menu-item-22441">
        <a href="http://dataunion.org/f-links">
         友情链接
        </a>
       </li>
       <li class="menu-item menu-item-type-post_type menu-item-object-page menu-item-20874" id="menu-item-20874">
        <a href="http://dataunion.org/aboutus">
         关于数盟
        </a>
       </li>
      </ul>
      <p class="banquan">
       数盟社区        ，
        做最棒的数据科学社区
      </p>
     </div>
     <div class="left">
      <ul class="bottomlist">
       <li>
        <a href="http://weibo.com/DataScientistUnion  " target="_blank" 　title="">
         <img src="http://dataunion.org/wp-content/themes/yzipi/images/weibo.png"/>
        </a>
       </li>
       <li>
        <a class="cd-popup-trigger" href="http://dataunion.org/16514.html#0">
         <img src="http://dataunion.org/wp-content/themes/yzipi/images/weixin.png"/>
        </a>
       </li>
      </ul>
      <div class="cd-popup">
       <div class="cd-popup-container">
        <h1>
         扫描二维码,加微信公众号
        </h1>
        <img src="http://dataunion.org/wp-content/themes/yzipi/images/2014-12-06-1515289049.png"/>
        <a class="cd-popup-close" href="http://dataunion.org/16514.html">
        </a>
       </div>
       <!-- cd-popup-container -->
      </div>
      <!-- cd-popup -->
     </div>
    </div>
    <!--about-->
    <div class="bottom">
     <a href="http://dataunion.org/">
      数盟社区
     </a>
     <a href="http://www.miitbeian.gov.cn/" rel="external nofollow" target="_blank">
      京ICP备14026740号
     </a>
     联系我们：
     <a href="mailto:contact@dataunion.org" target="_blank">
      contact@dataunion.org
     </a>
     <div class="tongji">
     </div>
     <!--bottom-->
     <div class="scroll" id="scroll" style="display:none;">
      ︿
     </div>
    </div>
   </footer>
   <!--dibu-->
  </div>
 </body>
</html>